Failure to compile with gcc 4.8
H.J. Lu
hjl.tools@gmail.com
Thu Apr 29 22:39:12 GMT 2021
On Thu, Apr 29, 2021 at 3:23 PM Simon Marchi via Binutils
<binutils@sourceware.org> wrote:
>
> Hi,
>
> I tried building the repo with gcc 4.8 and got:
>
> /home/smarchi/src/binutils-gdb/opcodes/ppc-dis.c: In function ‘print_insn_powerpc’:
> /home/smarchi/src/binutils-gdb/opcodes/ppc-dis.c:1071:8: error: ‘for’ loop initial declarations are only allowed in C99 mode
> for (int i = 0; i < 2; i++)
> ^
> /home/smarchi/src/binutils-gdb/opcodes/ppc-dis.c:1071:8: note: use option -std=c99 or -std=gnu99 to compile your code
>
> gcc 4.8 can compile C99, but we need to give it -std=c99 or -std=gnu99.
>
> Should we add this (and to other sub-directories too)?
>
> diff --git a/opcodes/configure.ac b/opcodes/configure.ac
> index 911c9c6f082..3e79d38971f 100644
> --- a/opcodes/configure.ac
> +++ b/opcodes/configure.ac
> @@ -26,6 +26,7 @@ AC_CANONICAL_TARGET
> AM_INIT_AUTOMAKE
>
> AC_PROG_CC
> +AC_PROG_CC_C99
> AC_GNU_SOURCE
> AC_USE_SYSTEM_EXTENSIONS
>
> Simon
https://sourceware.org/pipermail/binutils/2021-April/116325.html
--
H.J.
More information about the Binutils
mailing list