[PATCH] ppc: avoid C99-style loop

Mike Frysinger vapier@gentoo.org
Fri Apr 23 15:03:14 GMT 2021


On 23 Apr 2021 15:32, Jan Beulich via Binutils wrote:
> On 23.04.2021 15:29, Nick Clifton wrote:
> >> While work towards using/requiring C99 is underway, this "dialect" at
> >> present doesn't look to get enforced anywhere,
> > 
> > Well except for the fact that feature of the dialect are now being used 
> > in the sources...
> 
> Albeit for now only in a limited way.
> 
> >> .../opcodes/ppc-dis.c: In function ‘print_insn_powerpc’:
> >> .../opcodes/ppc-dis.c:1071: error: ‘for’ loop initial declaration used outside C99 mode
> > 
> > That error implies that the compiler can operate in C99 mode, but that 
> > it is not doing so.  Is this the case ?
> 
> Yes.
> 
> >  If so, then the real bug is 
> > that the compiler is not being given the flag(s) that it needs to enable 
> > this mode.
> 
> Right, as also expressed in a post-commit-message remark. I've
> also said there "but since this wasn't done so far, and since I
> wouldn't know where to put the addition, I opted for the more
> simplistic fix."

prob easy to fix though:
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -25,7 +25,7 @@ AC_CANONICAL_TARGET
 
 AM_INIT_AUTOMAKE
 
-AC_PROG_CC
+AC_PROG_CC_C99
 AC_GNU_SOURCE
 AC_USE_SYSTEM_EXTENSIONS
 
-mike


More information about the Binutils mailing list