This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Regression in 4.0 (sort of)



On Dec 12, 2004, at 8:07 PM, Zack Weinberg wrote:


Dale Johannesen <dalej@apple.com> writes:

Consider the nonstandard C program

main() {
   foo();
}
void foo() {
}


No; in fact I'm surprised that this exception


The following exception is already made for a different, but quite
similar, case.
/* Permit void foo (...) to match int foo (...) if the latter is
the definition and implicit int was used. See
c-torture/compile/920625-2.c. */

doesn't cover this case. I suppose it's because there's a difference between "declared implicitly" and "declared using implicit int". I'd be in favor of extending this case to cover your example.

No, it's because the code does exactly what the comment says: the implicit int must be the definition, and must be the second occurrence:

extern void foo();
foo() {}

I'll put together a patch.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]