From 060491ca21225166aa535bc1479eb0a33fb2ceb6 Mon Sep 17 00:00:00 2001 From: Johann Date: Mon, 4 Feb 2019 18:18:11 -0800 Subject: [PATCH] enforce some c89 restrictions Block "for (int i;;)" style declarations. Use --std=gnu89 to avoid enforcing c89-style comments. Change-Id: Ia7d1405eac647d04e92513c047773695e8d7dc6e --- configure | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configure b/configure index c8f1d35..e91b57a 100755 --- a/configure +++ b/configure @@ -625,6 +625,9 @@ process_toolchain() { if enabled mips || [ -z "${INLINE}" ]; then enabled extra_warnings || check_add_cflags -Wno-unused-function fi + # Enforce c89 for c files. Don't be too strict about it though. Allow + # gnu extensions like "//" for comments. + check_cflags -std=gnu89 && add_cflags_only -std=gnu89 # Avoid this warning for third_party C++ sources. Some reorganization # would be needed to apply this only to test/*.cc. check_cflags -Wshorten-64-to-32 && add_cflags_only -Wshorten-64-to-32 -- 2.7.4