Regression in 4.0 (sort of)
Zack Weinberg
zack@codesourcery.com
Mon Dec 13 04:07:00 GMT 2004
Dale Johannesen <dalej@apple.com> writes:
> Consider the nonstandard C program
>
> main() {
> foo();
> }
> void foo() {
> }
>
> Previous versions of gcc accepted this with a warning; 4.0 gives an
> error. This appears to date to Zack's rewrite of duplicate_decls
> early this year. Naturally, this is causing some programs not to
> compile any more. Geoff thinks this may be unintentional, and
> certainly it doesn't seem that any bugs that would actually cause
> anything to break would slip through if we treated it as a warning.
> Is this an intentional change?
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.
zw
More information about the Gcc
mailing list