|
I'm kind of curious as to what value the caller received if the 2nd
return was executed. Zero perhaps?
Von: david@xxxxxxxxxxxxvalue.
An: rpg400-l@xxxxxxxxxxxx,
Datum: 31.12.2013 16:28
Betreff: Interesting restriction on the rules between releases
Gesendet von: rpg400-l-bounces@xxxxxxxxxxxx
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
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 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.