Subject: Re: Documentation/languages...
To: None <firstname.lastname@example.org>
From: Peter Seebach <email@example.com>
Date: 05/18/1997 15:55:57
It's legal, (well, modulo envp, which is obsolete, and not a part of any
standard; use extern char **environ for POSIX.) but only because the
promoted types of int and char ** are int and char **.
*IS NOT LEGAL NOW*. It invokes undefined behavior, because foo is declared to
accept a char by the declaration, but an int by the definition, because the
old-style rule is that the standard promotions are applied to function
My ideal solution is to declare that
acts *EXACTLY* like
void foo(char c);
in C9X programs. Since the old-style declarations are obsolescent, any
code broken by this had it coming. (Regardless, C9X is almost guaranteed
to have either the "prototype-equivalent" old-style definitions, or none
People who need to use old code can do what they do now; use gcc -traditional.