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



Hi Barbara,

The procedure was called by another module, but it was also called internally. And when sombody changed the procedure interface, he forgot to change the prototype. Before that somebody else forgot to include the /copy with the prototype to the module containing the callee. Everything compiled fine, but the call from the external module did not work because of a parameter mismatch. The last parameter contained nothing but garbage and I wondered why.

I took me too long to find the problem, because I did not think at the prototype.

Opening a RFE is a good idea.

Thomas.

-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Barbara Morris
Gesendet: Montag, 19. Februar 2018 22:25
An: rpg400-l@xxxxxxxxxxxx
Betreff: Re: 7.1 and RPG prototypes

On 2018-02-19 9:23 AM, dlclark@xxxxxxxxxxxxxxxx
wrote:

In my experience, although prototypes are no longer required
for internal procedures, the compiler still requires a prototype for
external stored procedures or it gives a compile-time error that the
procedure is undefined.

That's true of a module that is calling a procedure in another module.

But a prototype isn't required within the module that is exporting the procedure.

Thomas, the reason that the compiler doesn't require a prototype is that it the procedure may not ever be called from another RPG module.

It wouldn't be possible for the compiler to change its rules and start requiring a prototype for exported procedures. But you could open an RFE to request an H spec option to require prototypes for programs and exported procedures.

--
Barbara

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


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.