Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Metzger\, Markus T" <markus.t.metzger@intel.com>
Cc: palves@redhat.com, brobecker@adacore.com,
	gdb-patches@sourceware.org, jan.kratochvil@redhat.com,
	simon.marchi@ericsson.com
Subject: Re: [PATCH 1/3] Introduce gdb::unique_ptr
Date: Wed, 12 Oct 2016 09:31:00 -0000	[thread overview]
Message-ID: <83insxc3rv.fsf@gnu.org> (raw)
In-Reply-To: <A78C989F6D9628469189715575E55B233FFE4E6C@IRSMSX104.ger.corp.intel.com>	(markus.t.metzger@intel.com)

> From: "Metzger, Markus T" <markus.t.metzger@intel.com>
> CC: "brobecker@adacore.com" <brobecker@adacore.com>,
> 	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>, "Jan Kratochvil
>  (jan.kratochvil@redhat.com)" <jan.kratochvil@redhat.com>, Simon Marchi
> 	<simon.marchi@ericsson.com>
> Date: Wed, 12 Oct 2016 08:11:44 +0000
> 
> I think we got hung up on the perceived requirement of having to build
> your own GCC.  The discussion got a bit too abstract and mentioning GCC 6
> as the first to default to C++11 may have been confusing in the heat of the
> discussion as "GCC 6 defaults to C++11" may have been misread as "C++11
> requires GCC 6".

I don't think that's what happened.  In my interpretation, there are
simply several issues intertwined in this discussion (which probably
adds to confusion):

  . Should we start using C++11 features in GDB?
  . If the answer to the above is YES, then should we require a C++11
    capable compiler as a prerequisite, or should we provide fallback
    code for compilers that don't support C++11, not even with a
    non-default command-line option?
  . Should we document these decisions and also decide to abide by
    them for some reasonably long stretch of time?

> A simple and pragmatic solution would be a patch to add -std=c++11
> to GDB's compiler options.  Pedro already mentioned it but I'm afraid it
> got lost.
> 
> This documents the required language version and also prevents people
> from accidentally using C++14/17/?? features and not noticing it until one of
> the buildbot builders complained.
> 
> I don't think that requiring C++11 is entirely unreasonable and IMHO
> preferable to back-porting standard library features.
> 
> Should I be wrong and C++11 is really not doable, I like Pedro's patch
> for giving the direction towards C++11.  I would still add a compiler option
> to enforce C++03 for the above reasons.

Here are my opinions on the above 3 issues:

  . I think we should stay with C++03 for at least a year.  Jumping
    from C90 to C++11 sounds too huge a jump.  Setting the bar on
    C++03 would mean we still allow GCC 4.3, AFAIU, which was released
    in 2008.  That's less than 10 years from today, so not too old
    IMO.  We could also decide to switch to C99-level compilers, which
    AFAIU means GCC 4.5, released in 2010.  (GCC 4.8.1, with its C++11
    support, was released in 2013.)

  . Whatever standard we decide to aim, we should require a compiler
    that is capable of supporting that standard, whether with or
    without optional command-line switches, and we should use those
    switches if necessary (detected by configure) during the build.
    We should not provide any fallback code for compilers that don't
    support the standard we decide to use -- such fallback code is
    just maintenance headache and in the long run means code that is
    rarely if ever tested.

  . We should clearly document these decisions, and abide by them.
    Resetting the bar to a higher standard should IMO be based on the
    number of years since the release of the first GCC that supports
    that standard.  The number of years we would like to aim for
    should also be a documented decision.


  reply	other threads:[~2016-10-12  9:31 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 16:46 [PATCH 0/3] More cleanup elimination / gdb::unique_ptr Pedro Alves
2016-10-10 16:46 ` [PATCH 3/3] 'struct parse_expression *' -> gdb::unique_ptr<expression> Pedro Alves
2016-10-10 16:46 ` [PATCH 1/3] Introduce gdb::unique_ptr Pedro Alves
2016-10-10 17:49   ` Simon Marchi
2016-10-10 18:03     ` Pedro Alves
2016-10-11  6:48   ` Metzger, Markus T
2016-10-11 10:23     ` Pedro Alves
2016-10-11 10:53       ` Andreas Schwab
2016-10-11 11:17       ` Metzger, Markus T
2016-10-11 11:43         ` Pedro Alves
2016-10-11 13:58           ` Yao Qi
2016-10-11 14:05           ` Trevor Saunders
2016-10-11 12:16       ` Joel Brobecker
2016-10-11 13:46         ` Pedro Alves
2016-10-11 14:47           ` Joel Brobecker
2016-10-11 15:17             ` Eli Zaretskii
2016-10-11 16:24               ` Pedro Alves
2016-10-11 16:58                 ` Eli Zaretskii
2016-10-11 17:41                   ` Pedro Alves
2016-10-11 18:37                     ` Eli Zaretskii
2016-10-11 19:19                       ` Pedro Alves
2016-10-11 20:47                         ` Eli Zaretskii
2016-10-11 21:32                           ` Pedro Alves
2016-10-12  6:34                             ` Eli Zaretskii
2016-10-12  8:11                               ` Metzger, Markus T
2016-10-12  9:31                                 ` Eli Zaretskii [this message]
2016-10-12 10:12                                   ` Pedro Alves
2016-10-12 11:05                                     ` Eli Zaretskii
2016-10-12 11:25                                       ` Pedro Alves
2016-10-12 11:45                                         ` Eli Zaretskii
2016-10-13 12:12                                           ` Pedro Alves
2016-10-12 10:28                                 ` Pedro Alves
2016-10-12 11:07                                   ` Eli Zaretskii
2016-10-12 11:19                                     ` Pedro Alves
2016-10-12 11:41                                       ` Eli Zaretskii
2016-10-12 11:55                                         ` Pedro Alves
2016-10-13  0:38                                   ` [PATCH] Enable C++11 starting with gcc 4.8 (was: Re: [PATCH 1/3] Introduce gdb::unique_ptr) Pedro Alves
2016-10-13  0:45                                     ` [PATCH 1/2] gdb: Import AX_CXX_COMPILE_STDCXX from the GNU Autoconf Archive Pedro Alves
2016-10-13  0:45                                     ` [PATCH 2/2] gdb: Enable C++11 if available Pedro Alves
2016-10-12  9:37                               ` [PATCH 1/3] Introduce gdb::unique_ptr Pedro Alves
2016-10-12 10:51                                 ` Eli Zaretskii
2016-10-12 11:15                                   ` Pedro Alves
2016-10-12 11:40                                     ` Eli Zaretskii
2016-10-12 11:45                                   ` Jan Kratochvil
2016-10-12 11:56                                     ` Luis Machado
2016-10-12 12:03                                     ` Eli Zaretskii
2016-10-13  9:07                                       ` Jan Kratochvil
2016-10-13 10:07                                         ` Eli Zaretskii
2016-10-13 10:27                                           ` Pedro Alves
2016-10-13 13:22                                             ` Eli Zaretskii
2016-10-13 13:36                                               ` Pedro Alves
2016-10-13 13:59                                                 ` Eli Zaretskii
2016-10-13 14:04                                                   ` Pedro Alves
2016-10-13 15:06                                                     ` Joel Brobecker
2016-10-13 10:46                                           ` Jan Kratochvil
2016-10-13 11:15                                             ` Pedro Alves
2016-10-13 13:28                                             ` Eli Zaretskii
2016-10-13 13:42                                               ` Pedro Alves
2016-10-13 14:07                                                 ` Eli Zaretskii
2016-10-11 19:23                       ` Simon Marchi
2016-10-11 20:54                         ` Eli Zaretskii
2016-10-11 21:28                           ` Simon Marchi
2016-10-12  6:23                             ` Eli Zaretskii
2016-10-11 21:16                         ` Jan Kratochvil
2016-10-11 17:15                 ` Luis Machado
2016-10-11 18:21                   ` Pedro Alves
2016-10-10 16:58 ` [PATCH 0/3] More cleanup elimination / gdb::unique_ptr Pedro Alves
2016-10-16  7:05   ` Tom Tromey
2016-10-17 13:57     ` Pedro Alves
2016-10-17 14:07       ` Tom Tromey
2016-10-17 14:59         ` Pedro Alves
2016-10-20 13:46   ` Pedro Alves

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=83insxc3rv.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.com \
    --cc=markus.t.metzger@intel.com \
    --cc=palves@redhat.com \
    --cc=simon.marchi@ericsson.com \
    /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