Next: , Previous: Ugly Assumed-Size Arrays, Up: Distensions


9.9.4 Ugly Null Arguments

The -fugly-comma option enables use of a single trailing comma to mean “pass an extra trailing null argument” in a list of actual arguments to an external procedure, and use of an empty list of arguments to such a procedure to mean “pass a single null argument”.

(Null arguments often are used in some procedure-calling schemes to indicate omitted arguments.)

For example, `CALL FOO(,)' means “pass two null arguments”, rather than “pass one null argument”. Also, `CALL BAR()' means “pass one null argument”.

This construct is considered “ugly” because it does not provide an elegant way to pass a single null argument that is syntactically distinct from passing no arguments. That is, this construct changes the meaning of code that makes no use of the construct.

So, with -fugly-comma in force, `CALL FOO()' and `I = JFUNC()' pass a single null argument, instead of passing no arguments as required by the Fortran 77 and 90 standards.

Note: Many systems gracefully allow the case where a procedure call passes one extra argument that the called procedure does not expect.

So, in practice, there might be no difference in the behavior of a program that does `CALL FOO()' or `I = JFUNC()' and is compiled with -fugly-comma in force as compared to its behavior when compiled with the default, -fno-ugly-comma, in force, assuming `FOO' and `JFUNC' do not expect any arguments to be passed.