× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



"How would the rule work? Just because a /COPY exists in the using routine that contains the prototypes doesn't mean it's the same /COPY used to compile the used routine."

True - all we are really talking about here is trying to raise the barrier to stupid mistakes. I have often found in dealing with clients that the original programmer did a good job but it was messed up subsequently by maintenance programmers who didn't really understand what they were doing.

As I pointed out in my earlier post, even a full blown system wide implementation that allowed the compiler to check via introspection is not completely bullet proof. The goal has to be just to get as close to "idiot proof" as possible or at least make it really hard for the idiots. The enforcement of /COPY would at least get past the idiotic "I don't like /COPY so I CC'd the prototypes into my program" type of error. And yes - I have seen that more times than I would like to count.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Mar 5, 2018, at 11:57 AM, Peter Dow <petercdow@xxxxxxxxx> wrote:

<snip>
What the compiler "sees" is effectively a single source - Yes. And I would be OK with a rule that says you MUST use /COPY (/INCLUDE) for prototypes. That does at least help to guarantee that there is only one place where they are coded.
</snip>

How would the rule work? Just because a /COPY exists in the using routine that contains the prototypes doesn't mean it's the same /COPY used to compile the used routine.

<snip>
What I don't understand is how you propose that the _using_ routine be informed of the interface requirements. If not via a prototype (and accepting that a system wide facility has too high a cost and too many issues) then how do you propose it could work?
</snip>

When I first started using procedures way back when, it was all within the same program, so it made sense that the compiler could simply check the PI specs. Then when I started using service programs, my first thought was that the compiled service program could have the PI specs available for the using routine to check. But that has the same problems as a /COPY -- if you're compiling in a development environment, the service program there may be different from the production environment's version, and boom! you're trying to figure out a mis-matched parameter issue.

-- *Peter Dow*

/Dow Software Services, Inc. 909 793-9050 petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx> pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /

--
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 thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.