From 2ea5467dfeb343bf0527d1bea298ccf01b7d491a Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 14 Jan 2017 20:27:30 +0100 Subject: [PATCH 1/2] Pass --std=gnu99 gcc or clang is default This ensures more consistent behaviour of header files. See also #1107 --- Makefile.aix | 2 +- Makefile.android | 2 +- Makefile.bsd | 2 +- Makefile.cygwin | 2 +- Makefile.haiku | 2 +- Makefile.hurd | 2 +- Makefile.ios | 2 +- Makefile.linux | 2 +- Makefile.macosx | 2 +- Makefile.mingw | 2 +- Makefile.mingw-msys | 2 +- Makefile.solaris | 2 +- NEWS | 4 ++++ 13 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Makefile.aix b/Makefile.aix index 3a2b6c0..26c196a 100644 --- a/Makefile.aix +++ b/Makefile.aix @@ -34,7 +34,7 @@ ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh) # options C_COMPILER = gcc -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -maix64 -Os +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H -maix64 -Os --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.android b/Makefile.android index 8350ca7..8dd4c1a 100644 --- a/Makefile.android +++ b/Makefile.android @@ -31,7 +31,7 @@ ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh) # options -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.bsd b/Makefile.bsd index 02b5131..751836a 100644 --- a/Makefile.bsd +++ b/Makefile.bsd @@ -31,7 +31,7 @@ SRCDIR ?= ./ ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh) # options -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused diff --git a/Makefile.cygwin b/Makefile.cygwin index 54c589d..f80ac1a 100644 --- a/Makefile.cygwin +++ b/Makefile.cygwin @@ -42,7 +42,7 @@ RC_COMPILER = windres LINKER = gcc TARGET_RC_COMPILER ?= $(RC_COMPILER) -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.haiku b/Makefile.haiku index 3120f30..682a5e9 100644 --- a/Makefile.haiku +++ b/Makefile.haiku @@ -31,7 +31,7 @@ ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh) # options -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.hurd b/Makefile.hurd index 696fbcb..83ac4ca 100644 --- a/Makefile.hurd +++ b/Makefile.hurd @@ -32,7 +32,7 @@ ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh) # options -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.ios b/Makefile.ios index 54b88b3..7661c8f 100644 --- a/Makefile.ios +++ b/Makefile.ios @@ -42,7 +42,7 @@ STATICBUILD = 1 # for Xcode 4: C_COMPILER ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/iPhoneOS.platform/Developer/usr/bin C_COMPILER ?= $(XCODE_TOOLPATH)/gcc LIBRARIAN ?= $(XCODE_DEVELOPER)/Platforms/iPhoneOS.platform/Developer/usr/bin/ar -C_COMPILER_OPTIONS ?= -no-cpp-precomp -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H -mno-thumb -isysroot $(XCODE_SDK) -arch $(ARCH) +C_COMPILER_OPTIONS ?= -no-cpp-precomp -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H -mno-thumb -isysroot $(XCODE_SDK) -arch $(ARCH) --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.linux b/Makefile.linux index aa0a771..7541bd7 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -32,7 +32,7 @@ ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh) # options -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.macosx b/Makefile.macosx index 6cf4f04..5952b12 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -39,7 +39,7 @@ POSTINSTALL_PROGRAM = $(XCODE_TOOL_PATH)/install_name_tool # options -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.mingw b/Makefile.mingw index c249f45..aaea198 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -43,7 +43,7 @@ EXE = .exe # options C_COMPILER ?= gcc -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.mingw-msys b/Makefile.mingw-msys index 5b2aab9..201f6eb 100644 --- a/Makefile.mingw-msys +++ b/Makefile.mingw-msys @@ -39,7 +39,7 @@ EXE = .exe # options -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 ifdef DEBUGBUILD C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused else diff --git a/Makefile.solaris b/Makefile.solaris index 03f372c..ff679f5 100644 --- a/Makefile.solaris +++ b/Makefile.solaris @@ -43,7 +43,7 @@ DISABLE_ANNOTATIONS= endif C_COMPILER_OPTIONS ?= -errtags -xdebugformat=stabs $(DISABLE_ANNOTATIONS) -DHAVE_CHICKEN_CONFIG_H else -C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H +C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H --std=gnu99 endif ifdef DEBUGBUILD diff --git a/NEWS b/NEWS index ac51659..ee8339d 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,10 @@ in, they are restored (fixes #1336, thanks to Joo ChurlSoo). This was a regression caused by the fix for #1227. +- Build system + - On platforms where gcc or clang are the default, the --std=gnu99 + option is used to get more consistent header behaviour (#1107). + 4.11.1 - Security fixes -- 2.1.4