This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Require C99 for bfd
- From: Jan Beulich <jbeulich at suse dot com>
- To: cbiesinger at chromium dot org
- Cc: binutils at sourceware dot org, Christian Biesinger <cbiesinger at google dot com>
- Date: Wed, 29 Jan 2020 15:41:10 +0100
- Subject: Re: [PATCH] Require C99 for bfd
- References: <20200129140820.218587-1-cbiesinger@chromium.org>
On 29.01.2020 15:08, cbiesinger@chromium.org wrote:
> From: Christian Biesinger <cbiesinger@google.com>
>
> This allows writing more modern code, such as not having to declare all
> variables at the top of a block.
>
> See also discussion at:
> https://sourceware.org/ml/binutils/2020-01/threads.html#00334
>
> Unfortunately, because of how the toplevel Makefile works, we have to
> override CC for this to work. gnulib/Makefile.am already has a workaround
> for this issue.
>
> My patch to fix this in the toplevel makefile has not gotten any attention
> so far:
> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg02237.html
>
> bfd/ChangeLog:
>
> 2020-01-29 Christian Biesinger <cbiesinger@google.com>
>
> * Makefile.am: Override CC to what configure detected.
> * Makefile.in: Regenerate.
> * configure: Regenerate.
> * configure.ac: Turn on C99 mode.
I'm not convinced of the move, but I'm also not in the position to
argue against it. However, I think precautions should be taken to
prevent headers of libraries made available for external consumption
to require use of C99 as well - C89 ought to remain sufficient for
them. In the Xen Project we make a wee attempt at something similar
(https://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=xen/include/Makefile;hb=refs/heads/staging),
to (hopefully) avoid gaining dependencies on gcc extensions. Maybe
something similar could be done here (unless there is something
like this already, and I'm simply unaware)?
Jan