[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Grubby - PATCH 4/4] Avoid C99 declaration inside for-loop

On 06/12/2012 07:40 PM, Adrian Perez de Castro wrote:


Peter Jones <pjones redhat com> writes:

On 06/11/2012 12:29 PM, Adrian Perez wrote:
Avoids declaring an integer variable inside the initializer of a for-loop.
This patch avoids needing to compile the source in C99 mode.
Ouch... This is s typo, ā€œC89ā€ should be written there.

Er, why?  The c99 way is *better*, and we can easily compile in C99 mode.

I'm using GCC in default mode, which is -std=gnu89, so C89. This is the
only variable declaration inside a for-loop control part, so maybe it
makes sense to declare ā€œiā€ outside the loop, to keep the style coherent.

I'm not really for making changes to support overriding the compiler flags
set in the Makefile.  I'm still not seeing any advantage.  Some other loops
don't use the C99 declarations simply because they're *older*.  I'd take
patches to fix them, but I don't find it necessary to do so either.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]