* Go C++ only
@ 2016-09-01 17:32 Pedro Alves
2016-09-01 17:48 ` Dmitry Samersoff
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Pedro Alves @ 2016-09-01 17:32 UTC (permalink / raw)
To: gdb
Hi all,
As last discussed, the general consensus was to make 7.12
the last gdb version that supports building with a C compiler.
I've been holding proposing to drop C-mode support in master
with the idea that that would help with all the bugfix
backporting going on. I've had to explain this several times
recently, as people are eager to use C++ features. Multiple
times this week, even.
At this point the backporting rate is quite low though, so
maybe it no longer makes that much sense to hold C++ back,
at least in new code.
What do people think? Time to march ahead?
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 17:32 Go C++ only Pedro Alves
@ 2016-09-01 17:48 ` Dmitry Samersoff
2016-09-01 18:07 ` Simon Marchi
2016-09-01 18:17 ` Joel Brobecker
2 siblings, 0 replies; 15+ messages in thread
From: Dmitry Samersoff @ 2016-09-01 17:48 UTC (permalink / raw)
To: Pedro Alves, gdb
[-- Attachment #1.1: Type: text/plain, Size: 906 bytes --]
Pedro,
I'm not a gdb developer but I'm *for* this changes.
+1
-Dmitry
On 2016-09-01 20:32, Pedro Alves wrote:
> Hi all,
>
> As last discussed, the general consensus was to make 7.12
> the last gdb version that supports building with a C compiler.
>
> I've been holding proposing to drop C-mode support in master
> with the idea that that would help with all the bugfix
> backporting going on. I've had to explain this several times
> recently, as people are eager to use C++ features. Multiple
> times this week, even.
>
> At this point the backporting rate is quite low though, so
> maybe it no longer makes that much sense to hold C++ back,
> at least in new code.
>
> What do people think? Time to march ahead?
>
> Thanks,
> Pedro Alves
>
--
Dmitry Samersoff
Saint Petersburg, Russia, http://devnull.samersoff.net
* There will come soft rains ...
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 17:32 Go C++ only Pedro Alves
2016-09-01 17:48 ` Dmitry Samersoff
@ 2016-09-01 18:07 ` Simon Marchi
2016-09-01 18:22 ` Pedro Alves
2016-09-01 18:17 ` Joel Brobecker
2 siblings, 1 reply; 15+ messages in thread
From: Simon Marchi @ 2016-09-01 18:07 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb
On 2016-09-01 13:32, Pedro Alves wrote:
> Hi all,
>
> As last discussed, the general consensus was to make 7.12
> the last gdb version that supports building with a C compiler.
>
> I've been holding proposing to drop C-mode support in master
> with the idea that that would help with all the bugfix
> backporting going on. I've had to explain this several times
> recently, as people are eager to use C++ features. Multiple
> times this week, even.
>
> At this point the backporting rate is quite low though, so
> maybe it no longer makes that much sense to hold C++ back,
> at least in new code.
>
> What do people think? Time to march ahead?
>
> Thanks,
> Pedro Alves
Are there some guidelines about which C++ features we can use or not?
Perhaps some precisions about the coding style, for C++-specific
constructs (e.g. initializer lists). I suppose we'll end up copying
what GCC does for the most part, but it should be clear.
Thanks!
Simon
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 17:32 Go C++ only Pedro Alves
2016-09-01 17:48 ` Dmitry Samersoff
2016-09-01 18:07 ` Simon Marchi
@ 2016-09-01 18:17 ` Joel Brobecker
2016-09-02 10:01 ` Yao Qi
2 siblings, 1 reply; 15+ messages in thread
From: Joel Brobecker @ 2016-09-01 18:17 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb
> As last discussed, the general consensus was to make 7.12
> the last gdb version that supports building with a C compiler.
>
> I've been holding proposing to drop C-mode support in master
> with the idea that that would help with all the bugfix
> backporting going on. I've had to explain this several times
> recently, as people are eager to use C++ features. Multiple
> times this week, even.
>
> At this point the backporting rate is quite low though, so
> maybe it no longer makes that much sense to hold C++ back,
> at least in new code.
I don't have a strong opinion, but can we perhaps try a compromise
where we would be using C++ features only in new units (unlikely to be
backported)? Even though the backporting rate is indeed probably low,
it would still be nice to make it as easy as possible. Or is this
not really a practical suggestion?
--
Joel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 18:07 ` Simon Marchi
@ 2016-09-01 18:22 ` Pedro Alves
2016-09-01 18:33 ` Simon Marchi
2016-09-01 18:36 ` Andrew Pinski
0 siblings, 2 replies; 15+ messages in thread
From: Pedro Alves @ 2016-09-01 18:22 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb
On 09/01/2016 07:07 PM, Simon Marchi wrote:
> Are there some guidelines about which C++ features we can use or not?
I think the biggest guideline so far is that people still want to build
gdb on systems with compilers that predate C++11, so we're stuck with
C++03 for the moment.
> Perhaps some precisions about the coding style, for C++-specific
> constructs (e.g. initializer lists).
List initialization is C++11, so it's out, at least for now.
> I suppose we'll end up copying
> what GCC does for the most part, but it should be clear.
Right, the proposal is to follow GCC's conventions:
https://sourceware.org/gdb/wiki/cxx-conversion#Coding_conventions
Naturally we'll need to update the coding standards
pages to mention C++ and point at that:
https://sourceware.org/gdb/wiki/Internals%20Coding-Standards
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 18:22 ` Pedro Alves
@ 2016-09-01 18:33 ` Simon Marchi
2016-09-01 18:48 ` Pedro Alves
2016-09-01 18:56 ` Pedro Alves
2016-09-01 18:36 ` Andrew Pinski
1 sibling, 2 replies; 15+ messages in thread
From: Simon Marchi @ 2016-09-01 18:33 UTC (permalink / raw)
To: Pedro Alves; +Cc: gdb
On 2016-09-01 14:22, Pedro Alves wrote:
> On 09/01/2016 07:07 PM, Simon Marchi wrote:
>
>> Are there some guidelines about which C++ features we can use or not?
>
> I think the biggest guideline so far is that people still want to build
> gdb on systems with compilers that predate C++11, so we're stuck with
> C++03 for the moment.
>
>> Perhaps some precisions about the coding style, for C++-specific
>> constructs (e.g. initializer lists).
>
> List initialization is C++11, so it's out, at least for now.
Oh, I meant the list of members to initialize in a constructor (the list
after the colon), that's not C++11 I believe. I see it's all discussed
in the gcc coding convention page.
And to complete my answer on the original subject, I think it's fine to
wait until 7.12 is out before checking in anything that is C++-only.
The wait has been long already, a few weeks won't change much :).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 18:22 ` Pedro Alves
2016-09-01 18:33 ` Simon Marchi
@ 2016-09-01 18:36 ` Andrew Pinski
2016-09-01 19:01 ` Eli Zaretskii
1 sibling, 1 reply; 15+ messages in thread
From: Andrew Pinski @ 2016-09-01 18:36 UTC (permalink / raw)
To: Pedro Alves; +Cc: Simon Marchi, GDB Development
On Thu, Sep 1, 2016 at 11:22 AM, Pedro Alves <palves@redhat.com> wrote:
> On 09/01/2016 07:07 PM, Simon Marchi wrote:
>
>> Are there some guidelines about which C++ features we can use or not?
>
> I think the biggest guideline so far is that people still want to build
> gdb on systems with compilers that predate C++11, so we're stuck with
> C++03 for the moment.
>
>> Perhaps some precisions about the coding style, for C++-specific
>> constructs (e.g. initializer lists).
>
> List initialization is C++11, so it's out, at least for now.
>
>> I suppose we'll end up copying
>> what GCC does for the most part, but it should be clear.
>
> Right, the proposal is to follow GCC's conventions:
>
> https://sourceware.org/gdb/wiki/cxx-conversion#Coding_conventions
>
> Naturally we'll need to update the coding standards
> pages to mention C++ and point at that:
>
> https://sourceware.org/gdb/wiki/Internals%20Coding-Standards
Note the only feature I want to use right now is bool instead of char
or int were the value is a boolean. This is new code and back-porting
is a simple change to char instead of bool so it is not normally a big
issue.
Thanks,
Andrew Pinski
>
> Thanks,
> Pedro Alves
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 18:33 ` Simon Marchi
@ 2016-09-01 18:48 ` Pedro Alves
2016-09-01 18:56 ` Pedro Alves
1 sibling, 0 replies; 15+ messages in thread
From: Pedro Alves @ 2016-09-01 18:48 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb
On 09/01/2016 07:33 PM, Simon Marchi wrote:
> On 2016-09-01 14:22, Pedro Alves wrote:
>>> Perhaps some precisions about the coding style, for C++-specific
>>> constructs (e.g. initializer lists).
>>
>> List initialization is C++11, so it's out, at least for now.
>
> Oh, I meant the list of members to initialize in a constructor (the list
> after the colon), that's not C++11 I believe. I see it's all discussed
> in the gcc coding convention page.
Ah, whooops, sorry. So that's I think the one detail that if you look
at gcc's code, you'll notice that in practice it deviates a little from
what the docs say. Most of the gcc code I looked at I think simply follows
what emacs with "c-set-style gnu" prefers, which is to indent
the initializer list by a couple spaces. Some random examples:
class pass_parallelize_loops : public gimple_opt_pass
{
public:
pass_parallelize_loops (gcc::context *ctxt)
: gimple_opt_pass (pass_data_parallelize_loops, ctxt),
oacc_kernels_p (false)
{}
[...]
class example_base
{
public:
example_base ()
: m_kind (0),
m_a (ggc_cleared_alloc <test_struct> ())
{}
[...]
bit_field_mode_iterator
::bit_field_mode_iterator (HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
HOST_WIDE_INT bitregion_start,
HOST_WIDE_INT bitregion_end,
unsigned int align, bool volatilep)
: m_mode (GET_CLASS_NARROWEST_MODE (MODE_INT)), m_bitsize (bitsize),
m_bitpos (bitpos), m_bitregion_start (bitregion_start),
m_bitregion_end (bitregion_end), m_align (align),
m_volatilep (volatilep), m_count (0)
{
While their docs say:
"(...) place the colon of the initializer clause at the beginning of a line.
gnuclass::gnuclass ()
: base1 (), base2 (), member1 (), member2 (), member3 (), member4 ()
{
...
};
I think that we should this a documentation bug, and that it's better
to follow gcc's _actual_ style in practice. Why fight
against emacs, right? :-)
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 18:33 ` Simon Marchi
2016-09-01 18:48 ` Pedro Alves
@ 2016-09-01 18:56 ` Pedro Alves
1 sibling, 0 replies; 15+ messages in thread
From: Pedro Alves @ 2016-09-01 18:56 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb
On 09/01/2016 07:33 PM, Simon Marchi wrote:
>
> And to complete my answer on the original subject, I think it's fine to
> wait until 7.12 is out before checking in anything that is C++-only.
> The wait has been long already, a few weeks won't change much :).
OTOH, there's most likely going to be a 7.12.1 too, so even though
we can aim at avoiding major impact on backports, it's looking like
the "7.12" milestone ends up being artificial.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 18:36 ` Andrew Pinski
@ 2016-09-01 19:01 ` Eli Zaretskii
2016-09-01 19:07 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Eli Zaretskii @ 2016-09-01 19:01 UTC (permalink / raw)
To: Andrew Pinski; +Cc: palves, simon.marchi, gdb
> From: Andrew Pinski <pinskia@gmail.com>
> Date: Thu, 1 Sep 2016 11:36:34 -0700
> Cc: Simon Marchi <simon.marchi@polymtl.ca>, GDB Development <gdb@sourceware.org>
>
> Note the only feature I want to use right now is bool instead of char
> or int were the value is a boolean.
You have bool in C.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 19:01 ` Eli Zaretskii
@ 2016-09-01 19:07 ` Pedro Alves
0 siblings, 0 replies; 15+ messages in thread
From: Pedro Alves @ 2016-09-01 19:07 UTC (permalink / raw)
To: Eli Zaretskii, Andrew Pinski; +Cc: simon.marchi, gdb
On 09/01/2016 08:00 PM, Eli Zaretskii wrote:
>> From: Andrew Pinski <pinskia@gmail.com>
>> Date: Thu, 1 Sep 2016 11:36:34 -0700
>> Cc: Simon Marchi <simon.marchi@polymtl.ca>, GDB Development <gdb@sourceware.org>
>>
>> Note the only feature I want to use right now is bool instead of char
>> or int were the value is a boolean.
>
> You have bool in C.
That's C99 only and requires including <stdbool.h>. Defining
it ourselves is likely to cause conflict problems. The best way to
make use of that would probably be to pull in gnulib's stdbool module,
though ISTR that's been tried and it caused trouble too.
It's just easier to wait for C++.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-01 18:17 ` Joel Brobecker
@ 2016-09-02 10:01 ` Yao Qi
2016-09-02 10:15 ` Pedro Alves
0 siblings, 1 reply; 15+ messages in thread
From: Yao Qi @ 2016-09-02 10:01 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Pedro Alves, gdb
On Thu, Sep 1, 2016 at 7:17 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>
> I don't have a strong opinion, but can we perhaps try a compromise
> where we would be using C++ features only in new units (unlikely to be
> backported)? Even though the backporting rate is indeed probably low,
> it would still be nice to make it as easy as possible. Or is this
> not really a practical suggestion?
>
I agree. If we think the patch is likely to be backported, such as bug fix,
C++ feature is not allowed in the patch.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-02 10:01 ` Yao Qi
@ 2016-09-02 10:15 ` Pedro Alves
2016-09-02 15:34 ` Sergio Durigan Junior
2016-09-02 20:10 ` Sergio Durigan Junior
0 siblings, 2 replies; 15+ messages in thread
From: Pedro Alves @ 2016-09-02 10:15 UTC (permalink / raw)
To: Yao Qi, Joel Brobecker; +Cc: gdb, Sergio Durigan Junior
On 09/02/2016 11:01 AM, Yao Qi wrote:
> On Thu, Sep 1, 2016 at 7:17 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>>
>> I don't have a strong opinion, but can we perhaps try a compromise
>> where we would be using C++ features only in new units (unlikely to be
>> backported)? Even though the backporting rate is indeed probably low,
>> it would still be nice to make it as easy as possible. Or is this
>> not really a practical suggestion?
>>
>
> I agree. If we think the patch is likely to be backported, such as bug fix,
> C++ feature is not allowed in the patch.
Agreed.
Sergio, can you switch the buildbot builder that is catching C
build regressions to test the 7.12 branch instead of master?
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-02 10:15 ` Pedro Alves
@ 2016-09-02 15:34 ` Sergio Durigan Junior
2016-09-02 20:10 ` Sergio Durigan Junior
1 sibling, 0 replies; 15+ messages in thread
From: Sergio Durigan Junior @ 2016-09-02 15:34 UTC (permalink / raw)
To: Pedro Alves; +Cc: Yao Qi, Joel Brobecker, gdb
On Friday, September 02 2016, Pedro Alves wrote:
> On 09/02/2016 11:01 AM, Yao Qi wrote:
>> On Thu, Sep 1, 2016 at 7:17 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>>>
>>> I don't have a strong opinion, but can we perhaps try a compromise
>>> where we would be using C++ features only in new units (unlikely to be
>>> backported)? Even though the backporting rate is indeed probably low,
>>> it would still be nice to make it as easy as possible. Or is this
>>> not really a practical suggestion?
>>>
>>
>> I agree. If we think the patch is likely to be backported, such as bug fix,
>> C++ feature is not allowed in the patch.
>
> Agreed.
>
> Sergio, can you switch the buildbot builder that is catching C
> build regressions to test the 7.12 branch instead of master?
Hm, I can try, yes. I'll let you know if it works.
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Go C++ only
2016-09-02 10:15 ` Pedro Alves
2016-09-02 15:34 ` Sergio Durigan Junior
@ 2016-09-02 20:10 ` Sergio Durigan Junior
1 sibling, 0 replies; 15+ messages in thread
From: Sergio Durigan Junior @ 2016-09-02 20:10 UTC (permalink / raw)
To: Pedro Alves; +Cc: Yao Qi, Joel Brobecker, gdb
On Friday, September 02 2016, Pedro Alves wrote:
> On 09/02/2016 11:01 AM, Yao Qi wrote:
>> On Thu, Sep 1, 2016 at 7:17 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>>>
>>> I don't have a strong opinion, but can we perhaps try a compromise
>>> where we would be using C++ features only in new units (unlikely to be
>>> backported)? Even though the backporting rate is indeed probably low,
>>> it would still be nice to make it as easy as possible. Or is this
>>> not really a practical suggestion?
>>>
>>
>> I agree. If we think the patch is likely to be backported, such as bug fix,
>> C++ feature is not allowed in the patch.
>
> Agreed.
>
> Sergio, can you switch the buildbot builder that is catching C
> build regressions to test the 7.12 branch instead of master?
Right, I've made a few modifications on the config files and the C-only
builder should now be building only changes to the 7.12 branch.
Let me know if it works, or if you need something else.
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2016-09-02 20:10 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-01 17:32 Go C++ only Pedro Alves
2016-09-01 17:48 ` Dmitry Samersoff
2016-09-01 18:07 ` Simon Marchi
2016-09-01 18:22 ` Pedro Alves
2016-09-01 18:33 ` Simon Marchi
2016-09-01 18:48 ` Pedro Alves
2016-09-01 18:56 ` Pedro Alves
2016-09-01 18:36 ` Andrew Pinski
2016-09-01 19:01 ` Eli Zaretskii
2016-09-01 19:07 ` Pedro Alves
2016-09-01 18:17 ` Joel Brobecker
2016-09-02 10:01 ` Yao Qi
2016-09-02 10:15 ` Pedro Alves
2016-09-02 15:34 ` Sergio Durigan Junior
2016-09-02 20:10 ` Sergio Durigan Junior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox