public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/6198: reaching end of main() should cause return with 0
@ 2002-04-05 23:16 jsm28
0 siblings, 0 replies; 2+ messages in thread
From: jsm28 @ 2002-04-05 23:16 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jsm28, nobody, safari
Synopsis: reaching end of main() should cause return with 0
State-Changed-From-To: open->closed
State-Changed-By: jsm28
State-Changed-When: Fri Apr 5 23:16:27 2002
State-Changed-Why:
GCC does this in C99 mode. If you are using the
compilation command defined by the Single Unix
Specification, c99, it should pass an appropriate -std
option to gcc (it's at present for distributors to
provide such a script, GCC doesn't itself); other
compilation commands are not in that specification.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6198
^ permalink raw reply [flat|nested] 2+ messages in thread
* c/6198: reaching end of main() should cause return with 0
@ 2002-04-05 17:36 safari
0 siblings, 0 replies; 2+ messages in thread
From: safari @ 2002-04-05 17:36 UTC (permalink / raw)
To: gcc-gnats
>Number: 6198
>Category: c
>Synopsis: reaching end of main() should cause return with 0
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Apr 05 17:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: safari@iki.fi
>Release: 3.0.4
>Organization:
>Environment:
Linux 2.4.19-pre3-aa2 i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /mnt/tmpfs/1/gcc-3.0.4/configure
>Description:
http://www.opengroup.org/onlinepubs/007904975/functions/exit.html
says:
"Reaching the end of the main() function has the same behavior as calling exit(0)."
however, gcc does not set %eax register to 0 before `ret', causing (on my system) this program to return with 1:
int main(void) { }
>How-To-Repeat:
>Fix:
trivial ;-D
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-04-06 7:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-05 23:16 c/6198: reaching end of main() should cause return with 0 jsm28
-- strict thread matches above, loose matches on Subject: below --
2002-04-05 17:36 safari
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).