public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Andrew Haley <aph@redhat.com>
Cc: gcc@gcc.gnu.org
Subject: Re: [RFC] Deprecate "implicit int" for main() in C++
Date: Wed, 25 Apr 2018 16:22:00 -0000	[thread overview]
Message-ID: <20180425155420.GA12873@redhat.com> (raw)
In-Reply-To: <736ee54e-fc2a-17f0-574a-6d889fdc2336@redhat.com>

On 25/04/18 16:30 +0100, Andrew Haley wrote:
>On 04/25/2018 03:04 PM, Jonathan Wakely wrote:
>> On 25/04/18 14:59 +0100, Andrew Haley wrote:
>>> On 04/25/2018 02:56 PM, Jason Merrill wrote:
>>>> The warning by default seems sufficient to me.
>>>
>>> Yes.  We've been bitten by this a few times, with mysterious crashes.
>>> I'm not sure it even makes sense only to be a warning, but I guess
>>> that's up to the C++ TC.
>>
>> It's not always possible for the compiler to prove that flowing off
>> the end never happens, even if the program state ensures that it can't
>> (e.g. by all callers enforcing the function's preconditions
>> correctly). So making it ill-formed is deemed too draconian whenever
>> this gets discussed.
>
>Sure.  Having said that, the cases that bit me were those where control
>always flowed off the end, i.e. the function contained no return statement.

I forget the "return *this;" in assignment operators embarrassingly
often. So often I've even contemplated a proposal to define flowing
off the end of an assignment operator equivalent to "return *this;"


  reply	other threads:[~2018-04-25 15:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 13:12 Jonathan Wakely
2018-04-25 13:57 ` Andrew Haley
2018-04-25 13:59   ` Jason Merrill
2018-04-25 14:04     ` Andrew Haley
2018-04-25 14:40       ` Jonathan Wakely
2018-04-25 15:48         ` Andrew Haley
2018-04-25 16:22           ` Jonathan Wakely [this message]
2018-04-25 16:45             ` David Malcolm
2018-04-25 17:13               ` Jonathan Wakely
2018-04-25 17:50                 ` Nathan Sidwell
2018-04-25 21:14                   ` Jonathan Wakely
2018-04-25 15:31   ` Jonathan Wakely
2018-04-25 15:54     ` Jason Merrill
2018-05-08 11:36     ` Florian Weimer
2018-05-08 11:39       ` Jonathan Wakely
2018-05-08 12:02       ` Andreas Schwab

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=20180425155420.GA12873@redhat.com \
    --to=jwakely@redhat.com \
    --cc=aph@redhat.com \
    --cc=gcc@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).