|
Doug,
Did the problem arise for an exported procedure called by another module?
I created RFE 117030 to address that problem.
https://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=117030
Briefly described the problem is that the compiler does not enforce a
prototype for exported procedures. That can lead to a situation where the
procedure interface does not match the prototype (stored in a /copy member)
and where a caller, that relies on the prototype, passes the wrong
parameters to the procedure.
It is really nice that we no longer have to include the prototype for
private procedures. But for exported procedures (Keyword: "export") the
compiler MUST enforce the presence of a prototype.
Just my 2 cents.
Thomas.
-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Doug
Englander
Gesendet: Mittwoch, 22. August 2018 19:37
An: rpg400-l@xxxxxxxxxxxx
Betreff: Prototype definition enforcement
Does anyone know if there is a way to have the compiler enforce [DCL-PR]
prototype definitions against its associated DCL-PI definition? Earlier
versions of RPG [i.e. maybe before V7R1] the compiler would give a message
when the DCL-PR specs for a subprocedure in a module did not agree with the
corresponding DCL-PI specs. Now that the compiler rules have been relaxed,
it is now easier to have the DCL-PI and corresponding DCL-PR specs to
become out of sync. For example, I have a DCL-PI in a module that does not
accept parameters and just returns a value. I have changed the DCL-PR specs
that are in a copybook, and they are pulled in, but they have defined
parameter values being passed in. The compiler does not give any message
about this. Does anyone know if there is a way to get the compiler to
enforce the definitions like it used to do?
Thank you,
Doug
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
--
IMPORTANT NOTICE:
This email is confidential, may be legally privileged, and is for the
intended recipient only. Access, disclosure, copying, distribution, or
reliance on any of it by anyone else is prohibited and may be a criminal
offence. Please delete if obtained in error and email confirmation to the
sender.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.