This is the mail archive of the gcc-patches@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: Patch to fix gcc.dg/pr35899.c failure on IA64 HP-UX


Steve Ellcey <sje@cup.hp.com> writes:

> 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?

That is what I would have expected gcc to do already.  If it's not
doing that, I think there is a bug.

Ian


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