From patchwork Sat Mar 30 14:29:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 1070858 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=bootlin.com Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44Wgwm26kvz9sRQ for ; Sun, 31 Mar 2019 01:29:42 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id ADFCAC21E49; Sat, 30 Mar 2019 14:29:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3366AC21D83; Sat, 30 Mar 2019 14:29:35 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 944F7C21D83; Sat, 30 Mar 2019 14:29:33 +0000 (UTC) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lists.denx.de (Postfix) with ESMTPS id 87EBCC21D56 for ; Sat, 30 Mar 2019 14:29:32 +0000 (UTC) X-Originating-IP: 86.206.237.96 Received: from localhost (lfbn-tou-1-411-96.w86-206.abo.wanadoo.fr [86.206.237.96]) (Authenticated sender: thomas.petazzoni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 14A16C0003; Sat, 30 Mar 2019 14:29:31 +0000 (UTC) From: Thomas Petazzoni To: u-boot@lists.denx.de Date: Sat, 30 Mar 2019 15:29:23 +0100 Message-Id: <20190330142923.18385-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Cc: Thomas Petazzoni Subject: [U-Boot] [PATCH] tools/Makefile: build host tools with -std=gnu99 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Parts of the code are using C99 constructs (such as variables declared inside loops), but also GNU extensions (such as typeof), so using -std=gnu99 is necessary to build with older versions of gcc that don't default to building with gnu99. It fixes the following build failure: ./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 for (int i = 0; i < len; i++) ^ ./tools/../lib/crc16.c:70:2: note: use option -std=c99 or -std=gnu99 to compile your code when building the host tools with gcc 4.7. Signed-off-by: Thomas Petazzoni Reviewed-by: Philipp Tomsich --- tools/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index 081383d7a7..d377d85f74 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -254,7 +254,8 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \ -I$(srctree)/tools \ -DUSE_HOSTCC \ -D__KERNEL_STRICT_NAMES \ - -D_GNU_SOURCE + -D_GNU_SOURCE \ + -std=gnu99 __build: $(LOGO-y)