Skip to content

Linter marks program main procedure as unreferenced if ctl-opt is in copybook #322

Open
@EVLSDE

Description

Describe the bug
If you use a copybook for your control statements and include the main() statement, a program using this copybook will have its correctly defined main procedure marked as "No reference to definition.".

To Reproduce
Let's say you want to use a standard name for the main procedure of your programs, e.g. "Main".
You define a copybook (e.g. "qcpylesrc/cpypgm_h.rpgle", which includes the following statement:
ctl-opt main(Main);

You include the copybook in your program source and define the main procedure:

/copy 'qcpylesrc/cpypgm_h.rpgle'

dcl-proc Main;

Then the main procedure will be marked as "no reference to definition" by the linter.
If you replace the /copy in the program source with its contents, the same warning disappears.

Expected behavior
The linter should not be marking the procedure as "No reference to definition.", because the ctl-opt statement clearly takes use of it.

Screenshots
See example code given above

Environment:

  • Extension version v0.26.8
  • IBM i OS version 7.4

Additional context
None.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions