This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Allow C99/C11 in bfd?
- From: "Christian Biesinger via binutils" <binutils at sourceware dot org>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Nick Clifton <nickc at redhat dot com>, binutils at sourceware dot org, gdb at sourceware dot org
- Date: Fri, 24 Jan 2020 17:33:59 +0100
- Subject: Re: Allow C99/C11 in bfd?
- References: <CAPTJ0XGOYJf9Q_bdgHcLe9+PUp910NxXQsswfVht-=dBRbdDWA@mail.gmail.com> <f9e166e2-a473-a521-d091-595d22b694da@redhat.com> <20200124132004.GA7409@adacore.com>
- Reply-to: Christian Biesinger <cbiesinger at google dot com>
On Fri, Jan 24, 2020 at 2:20 PM Joel Brobecker <brobecker@adacore.com> wrote:
>
> > > (I'm not even going to ask about C++, although I think that would be nice)
> >
> > Bah! Real programmers don't use C++! Just joking of course,
> > but I seriously doubt that we will want to change the code base
> > now. Speaking personally I am much more comfortable with C
> > than with C++, but that is probably just me.
>
> The way the Pro C++ members of the GDB community approached the
> suggestion was by building a case of what C++ would bring,
> concretely, in terms of improvement. They also had a transition
> plan. As someone who was _not_ in favor of the switch to C++, I had
> to admit that the C++ proponents had some solid points and that
> those against did not have a solid counter-argument. It took
> a while, as a decision of this magnitude always takes, but
> it helped us keep the discussions focused on factual technical
> arguments. I thought that worked really way for the GDB group.
>
> Assuming the community is not refusing to even hear about the idea,
> how things happened in GDB could be inspiration for how to at least
> debate the merits of the change.
OK. I'm definitely not ready right now to make a full case for
switching to C++. Advantages, of course, include easier memory
handling with smart pointers and easier string handling with
std::string.
> Note that the idea might be dead right off the bat if being
> usable from C is an objective of the binutils project. For
> a relatively low-level library like this one, I wouldn't personally
> be surprised.
Well, you could still use extern "C" for any entry points and still
get a lot of advantages.
Anyway, OK, since initial opinions on C99 sound promising I guess I'll
send a patch to enable the C99 flag and see if anyone else has
opinions. It does not look like autoconf has an easy way to enable
C11?!
Christian