Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Migration Guide

IBM2412: missing RETURNS option

This message alerts you to a related coding error:

  IBM2412I E  Procedure has no RETURNS attribute, but contains a RETURN statement.
              A RETURNS attribute will be assumed.

This is the inverse problem to the problem that message IBM2409 flags: here there is a RETURN statement with an expression, but it is inside a PROCEDURE that is a subroutine rather than a function (i.e. inside a PROCEDURE that does not have the RETURNS options). The compiler will assume a RETURNS attribute for the PROCEDURE, but these assumed attributes may not be what you intended. More importantly, if the invoker of this routine invoked it via a CALL statement, then if this RETURN statement were executed, it would assign the return value to storage allocated for other purposes, and that could have unpredictable and arbitrarily bad consequences.

Code that produces this message should be corrected.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)