From fa13cc964c4ee44b278ba78b23d9fac2f152ba09 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 11 Jan 2021 11:47:55 +0700 Subject: [PATCH] Switch to compiling as ISO C99 + GNU extensions. (#203) We currently build for ISO C90 with GNU extensions. The GNU extensions include both library and language features. Compiling without GNU extensions results in a number of compilation failures due to use of those library features. With this, we'll build for ISO C99 with the GNU extensions and can evaluate what's going on with those library features in the future. --- CMakeLists.txt | 2 +- bin/makefile-header | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7c7d10..d9956f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.15) SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) -SET(CMAKE_C_STANDARD 90) +SET(CMAKE_C_STANDARD 99) IF(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_COMPILER_ID MATCHES "GNU") IF(UNIX AND CMAKE_GENERATOR STREQUAL "Ninja") diff --git a/bin/makefile-header b/bin/makefile-header index 0756251..6f3a3d5 100755 --- a/bin/makefile-header +++ b/bin/makefile-header @@ -14,8 +14,8 @@ AR = ar rcv ANSICC = $(CC) # Compiler flags -CLANG_CFLAGS = -std=gnu89 -funsigned-char -fno-strict-aliasing -fwrapv -GCC_CFLAGS = -std=gnu89 -funsigned-char -fno-strict-aliasing -fwrapv +CLANG_CFLAGS = -std=gnu99 -funsigned-char -fno-strict-aliasing -fwrapv +GCC_CFLAGS = -std=gnu99 -funsigned-char -fno-strict-aliasing -fwrapv # for the files that need to be included in byte-swapped implementations: BYTESWAPFILES =