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



I found the exact same thing yesterday when attempting to change a program
that was first compiled V5R4. The procedure had a subroutine with return and
no value. It was failing on V7R1 with the new changed. Clearly in previous
V5R4 compile it did not.

Find strange things all of a sudden .

Bill

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of David Gibbs
Sent: December 31, 2013 10:29 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Interesting restriction on the rules between releases

Folks:

I just noticed something interesting ... some rules got tightened in the RPG
compiler between V5R4 & 6.1.

We have a procedure that returns a 4,0 number ... the prototype & interface
both specify the return value.

The procedure is coded with multiple exit points. One in the middle of the
logic (a short circuit exit) and another at the very end.

The short circuit exit is coded as 'return value;'. The exit at the end is
just a 'return;'. Clearly a coding error.

On the face of it, I would expect this compile to fail due to the lack of a
return value on the 2nd return. But, on V5R4, it doesn't. The compile WILL
fail if neither of the return statements specify a value.

On 6.1, however, the compile DOES fail because the 2nd return statement
doesn't specify a value.

I'm kind of curious as to what value the caller received if the 2nd return
was executed. Zero perhaps?

david

--
IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding a metric century (100 km / 62 miles) in the 2014 Chicagoland Tour
de Cure to raise money for diabetes research, education, and advocacy.
Sponsor me by visiting http://archive.ridewithdavid.com. Any amount is
appreciated.
--
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: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


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.