This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to fix gcc.dg/pr35899.c failure on IA64 HP-UX
On Thu, 2008-07-31 at 12:44 -0700, Andrew Pinski wrote:
> I think we should error out on this code even without -pedantic-errors
> as the code will never work correctly.
>
> -- Pinski
For those who haven't checked out gcc.dg/pr35899.c it is basically:
int foo (void)
{
int a = bar ();
return a;
}
void bar (void) { }
When I compile this with the HP compiler I do get an error. Basically,
the compiler seems to have implicitly made bar() an integer function
when it saw the use of it and then when it was 'redeclared' to be void
the compiler gave a hard error. If I later declare bar to be int
instead of void then the program would compile with the HP compiler.
Is that the sort of behaviour you think GCC should have?
Steve Ellcey
sje@cup.hp.com