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] Loop bug generates invalid code on s390


Jakub Jelinek wrote:

>Then you can write:
>{ dg-do run }
>{ dg-options "-O2" }
>{ dg-options "-O2 -fPIC" { target s390*-*-* } }

OK, I'll do that.

> > > Also, there is missing exit (0) or return 0 in main ().
> > 
> > This is not required by the C standard.  (C99: 5.1.2.2.3)
> 
> Only C99+ though, and you are not passing -std=c99 nor -std=gnu99.
> GCC only adds implicit return 0 if -std={c,gnu}99.

While I don't have the C89 standard, I had been under the 
impression that the implicit return 0 was OK there as well.

And I've just verified that gcc accepts
  int main (void) { }
without warning and generates code to return 0 even with
  -Wall -Wextra -std=c89 -pedantic

But I'll add an explicit return 0 anyway ...

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


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