On Mon, 20 Oct 2025 16:51:30 -0400, Phil Smith III <[email protected]> wrote:

>Great! Will it warn about more %n$ than are supported? I hope? Not that we're 
>likely to make that mistake again...
>
>...phsiii (limping still from self-inflicted foot wound)
>

Unfortunately, that is something most compilers won’t be able to do since it 
depends on the execution environment. i.e. The limit is dependent on the C 
runtime environment (given by the limits.h header and the specific 
implementation of printf used at runtime). The compiler itself can generally 
NOT know what the runtime environment is, so it can’t know the actual limit, 
and hence can’t diagnose it reliably.

For example, say you are planning on using your own specially created C runtime 
(“Phil’s Super POSIX environment for z/OS!”) that allows 42 positional 
arguments. You would not want the compiler to complain saying that it only 
allows 9 positional arguments (since it is assuming Language Environment for 
that particular version/release is being used, and the application won’t be 
used on any future version/release of LE).



Regards,

z/OS XL C/C++ Compiler Team

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to