From: Christopher Layne <clayne@anodized.com>
To: Axel Freyn <axel-freyn@gmx.de>
Cc: gcc-help@gcc.gnu.org
Subject: Re: G++/GCC not detetcing stupid errors in code.
Date: Mon, 09 Jun 2008 00:44:00 -0000 [thread overview]
Message-ID: <20080609004353.GN18743@ns1.signalpunk.com> (raw)
In-Reply-To: <20080522122005.GA12930@localhost.localdomain>
On Thu, May 22, 2008 at 02:22:49PM +0200, Axel Freyn wrote:
> I would expect that this warning does not exist, because omitting the return-statement in
> "main" is perfectly valid in C++: (C++-Standard, 3.6.1.3)
> "If control reaches the end of main without encountering a return statement, the
> effect is that of executing return 0;"
>
> For other functions, g++ also emits a warning if you forget the return
> statement.
>
> Axel
This is something, that while valid by the C++ "Standard", I surely hope
doesn't become common practice.
-cl
next prev parent reply other threads:[~2008-06-09 0:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-22 8:56 Laurent Dufréchou
2008-05-22 9:00 ` Sven Eschenberg
2008-05-22 10:53 ` Laurent Dufrechou
[not found] ` <-457754682823264016@unknownmsgid>
2008-05-22 11:55 ` Tom Browder
2008-05-22 12:09 ` Laurent Dufréchou
2008-05-22 12:23 ` Andrew Haley
2008-05-22 18:38 ` Laurent Dufréchou
2008-05-22 12:24 ` Axel Freyn
2008-06-09 0:44 ` Christopher Layne [this message]
2008-05-23 2:16 ` Tom Browder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080609004353.GN18743@ns1.signalpunk.com \
--to=clayne@anodized.com \
--cc=axel-freyn@gmx.de \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).