I have a quick question from Ada. If I have a procedure in which I can write a variable, or I can leave it alone, should it be a parameter Outor In Out? I think it comes down to the question:
What the caller sees is he calling a procedure with a parameter Out, but the procedure does not concern the parameter. Does he see the same meaning? Undefined behavior?
The compiler does not complain because it sees the purpose of the variable Out... it is just in a conditional expression where it cannot be reached, and the compiler does not bother to check all the paths.
I suspect that a safe bet indicates the parameter as In Out, but I would like to know if this is necessary or just stylistically preferable.
Thank!
-prelic
source
share