Closed BrianGodsend closed 1 year ago
@BrianGodsend What other procedures accept a raw procedure name like %PADDR
?
There are a few places a procedure name (or prototype) may be specified. Just clicking through them in my head, I get the following:
Control options (Ctl-Opt):
Data definitions:
BIFs:
Looking at the list, I think you will potentially have problems primarily with MAIN, LIKE, OVERLOAD, and %paddr(). On second thought, you may have problems with them all. I believe the EXTPROC, EXPORT, and IMPORT do not require the values to be quoted ... this may be limited to fixed format (traditional syntax) source.
This may be just useless trivia as I do not think it will impact the linter, but be aware that at times a procedure name may be determined by a constant value as apposed to a literal value. IBM does this quite often when defining prototypes for the C/C++ functions. For example:
/IF DEFINED(LARGE_FILES)
dcl-c open_function 'open64';
/ELSE
dcl-c open_function 'open';
/ENDIF
dcl-pr open int(10) extproc(*CWIDEN : open_function);
path pointer value options(*STRING);
end-pr;
@BrianGodsend Thanks foe the great list. I believe the control options and data definition keywords already handle this case, just not %PADDR
! I will do this today or this weekend.
Thank you!
Thank YOU!
I also thought about snd-msg
. It has the optional parameter %target()
which, of course, accepts a program or procedure name. However, as with other unmentioned uses, the procedure name in %target()
is required to be quoted and so will not come into play.
Released with 0.21.4.
The
%PADDR
BIF accepts either a string or a prototype as its one and only parameter. If a prototype is used and the RPG lint settingRequiresParameter
is enabled, the line is flagged with theProcedure calls require brackets.
. In the context of the%PADDR
BIF, parentheses cannot be used on the prototype (subprocedure) name.The RPG linter should not be flagging prototype names used in
%PADDR
as needing parentheses.For example: