From: Tom Rini Date: Wed, 13 Feb 2019 19:31:33 -0500 Subject: [U-Boot] [PATCH] lib/crc16: use non-C99 loop style In-Reply-To: <20190213215728.21603-1-thomas.petazzoni@bootlin.com> References: <20190213215728.21603-1-thomas.petazzoni@bootlin.com> Message-ID: <20190214003133.GC21737@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Feb 13, 2019 at 10:57:28PM +0100, Thomas Petazzoni wrote: > Commit 51c2345bd24837f9f67f16268da6dc71573f1325 ("Roll CRC16-CCITT > into the hash infrastructure") has modified the crc16 code by adding a > C99-style loop where the loop iterator is declared inside the for() > statement. This breaks the build with old compiler such as gcc 4.7, > that do not default to C99: > > ./tools/../lib/crc16.c: In function 'crc16_ccitt': > ./tools/../lib/crc16.c:70:2: error: 'for' loop initial declarations are only allowed in C99 mode > ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code > > Switching to the regular coding style used in the rest of U-Boot > allows to fix this build issue. > > Signed-off-by: Thomas Petazzoni So first, as Philipp notes we require gcc-6 or later for U-Boot itself. But you're hitting this on the host and I assume something uncommon but not unsupported yet where it's still on gcc-4.7. So I'm inclined to allow the patch and just note that we're likely to have other breakage in the future. Also, can you please v2 and reword with a Fixes tag instead? Thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: