[Bug c/86178] No warning when missing return from function main()

2018-06-17 Thread jg at jguk dot org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86178

--- Comment #3 from Jonny Grant  ---
oops, my bad

[Bug c/86178] No warning when missing return from function main()

2018-06-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86178

--- Comment #2 from Jonathan Wakely  ---
See 4) at http://en.cppreference.com/w/cpp/language/main_function#Explanation

There's also an implicit "return 0;" for C, but only since C99 and only when
the return type of main is compatible with int. See 3) at 
http://en.cppreference.com/w/c/language/main_function

[Bug c/86178] No warning when missing return from function main()

2018-06-16 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86178

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |INVALID

--- Comment #1 from Jonathan Wakely  ---
You've set component=c but you're using g++ which means you're compiling C++
and so there's an implicit "return 0;" from main.