public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: Christian Biesinger <cbiesinger@google.com>
Cc: binutils@sourceware.org, gdb@sourceware.org
Subject: Re: Allow C99/C11 in bfd?
Date: Tue, 28 Jan 2020 01:29:00 -0000	[thread overview]
Message-ID: <20200128012949.GY4433@bubble.grove.modra.org> (raw)
In-Reply-To: <CAPTJ0XGOYJf9Q_bdgHcLe9+PUp910NxXQsswfVht-=dBRbdDWA@mail.gmail.com>

On Thu, Jan 23, 2020 at 11:37:27AM +0100, Christian Biesinger via binutils wrote:
> I noticed that bfd is currently using C89. I was wondering if there
> are any thoughts on allowing C99/C11 in there? It would be nice to be
> able to declare variables at the time of first use, among other useful
> features.

It wasn't so long ago that we were using K&R.  :-)

One of the reasons people used to give for being conservative is that
binutils is right at the bottom of the toolchain, and when
bootstrapping a new native GNU toolchain target you might not have
much in the way of native compiler support.  If there isn't an
intention of porting gcc for the target (or such support is delayed)
then cross-compiling might not be an option.  This all presumes a
native development system running some sort of OS, but those days are
past.  With the ubiquity of PCs, nowadays you'll invariably have a
cross-toolchain for a new cpu.  So there isn't any real reason to
stick with c89 IMO.

> (I'm not even going to ask about C++, although I think that would be nice)

I think any meaningful use of C++ would require a rewrite of BFD.

Just satisfying -Wc++-compat is a waste of time and results in a lot
of useless casts on bfd_alloc and similar that clutter the source.

-- 
Alan Modra
Australia Development Lab, IBM

      parent reply	other threads:[~2020-01-28  1:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23 10:38 Christian Biesinger via gdb
2020-01-24 11:50 ` Nick Clifton
2020-01-24 13:20   ` Joel Brobecker
2020-01-24 16:34     ` Christian Biesinger via gdb
2020-01-28  1:29 ` Alan Modra [this message]

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=20200128012949.GY4433@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=cbiesinger@google.com \
    --cc=gdb@sourceware.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).