Skip to content

Commit aebe4d8

Browse files
committed
Bump our language requirements to gnu11 & gnu++17
.. this is supported in buster (gcc8) and newer
1 parent be2f84e commit aebe4d8

File tree

6 files changed

+1090
-142
lines changed

6 files changed

+1090
-142
lines changed

src/Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,16 @@ INCLUDE += $(LIBTIRPC_CFLAGS)
244244
# Compilation options. Perhaps some of these should come from Makefile.inc? (CXXFLAGS now does)
245245
INTEGER_OVERFLOW_FLAGS := -fwrapv
246246
OPT := -Os $(INTEGER_OVERFLOW_FLAGS)
247-
DEBUG := $(DEBUG) -g -Wall -Wno-stringop-truncation
248-
CFLAGS := $(INCLUDE) $(OPT) $(DEBUG) $(EXTRA_DEBUG) -DULAPI -std=gnu99 -fgnu89-inline -Werror=implicit-function-declaration $(CFLAGS) $(CPPFLAGS)
249-
CXXFLAGS := $(INCLUDE) $(EXTRA_DEBUG) -DULAPI $(DEBUG) $(OPT) -Woverloaded-virtual $(CXXFLAGS) $(CPPFLAGS)
250-
CXXFLAGS += $(call cxx-option, -Wno-psabi)
251-
CXXFLAGS += $(call cxx-option, -std=gnu++11, -std=gnu++0x)
247+
DEBUG := $(DEBUG) -g -Werror -Werror=all -Wstringop-truncation -Wno-stringop-truncation
248+
CFLAGS := $(INCLUDE) $(OPT) $(DEBUG) $(EXTRA_DEBUG) -DULAPI -std=gnu11 -Werror=implicit-function-declaration $(CFLAGS) $(CPPFLAGS)
249+
CXXFLAGS := $(INCLUDE) $(EXTRA_DEBUG) -DULAPI $(DEBUG) $(OPT) -Werror=overloaded-virtual $(CXXFLAGS) $(CPPFLAGS)
250+
CXXFLAGS += -std=gnu++17
252251
# In Debian 11, any inclusion of <boost/python.hpp> leads to several
253252
# diagnostics from included headers about deprecated features. LinuxCNC does
254253
# not directly use these deprecated features, but it does use boost::python.
255254
# Silence the warnings just when they occur in files using boost/python.hpp by
256255
# adding SILENCE_BOOST_INTERNAL_DIAGNOSTICS_FLAGS to the object's EXTRAFLAGS
257256
SILENCE_BOOST_INTERNAL_DIAGNOSTICS_FLAGS = -DBOOST_ALLOW_DEPRECATED_HEADERS=1 -DBOOST_BIND_GLOBAL_PLACEHOLDERS=1
258-
259257
CFLAGS += $(TOOL_NML_FLAG)
260258
CXXFLAGS += $(TOOL_NML_FLAG)
261259

@@ -877,7 +875,7 @@ EXTRA_CFLAGS := $(filter-out -ffast-math,$(RTFLAGS)) -D__MODULE__ -I$(BASEPWD)/.
877875
-I$(BASEPWD)/emc/nml_intf -I$(BASEPWD)/emc/kinematics -I$(BASEPWD)/emc/tp -I$(BASEPWD)/emc/motion \
878876
-DSEQUENTIAL_SUPPORT -DHAL_SUPPORT -DDYNAMIC_PLCSIZE -DRT_SUPPORT -DOLD_TIMERS_MONOS_SUPPORT -DMODBUS_IO_MASTER \
879877
-fno-fast-math $(call cc-option,-mieee-fp) -fno-unsafe-math-optimizations \
880-
-Wframe-larger-than=2560 -Wno-declaration-after-statement \
878+
-Werror=frame-larger-than=2560 -Wno-declaration-after-statement \
881879
$(INTEGER_OVERFLOW_FLAGS)
882880
ifneq ($(KERNELRELEASE),)
883881
ifeq ($(RTARCH):$(RTAI):$(filter $(RTFLAGS),-msse),x86_64:3:)

src/configure.ac

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,15 @@ fi
3333
AC_PROG_CXX
3434
AC_PROG_INSTALL
3535

36-
m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
36+
m4_include([m4/ax_require_defined.m4])
37+
m4_include([m4/ax_cxx_compile_stdcxx.m4])
38+
m4_include([m4/ax_cxx_compile_stdcxx_17.m4])
3739
m4_include([m4/ax_python.m4])
3840
m4_include([m4/ax_python_devel.m4])
3941
m4_include([m4/ax_boost_base.m4])
4042
m4_include([m4/ax_boost_python.m4])
4143
# make this optional - it will likely only result in warnings
42-
AX_CXX_COMPILE_STDCXX_11(noext,optional)
44+
AX_CXX_COMPILE_STDCXX_17(ext,mandatory)
4345

4446
AC_MSG_CHECKING(build toplevel)
4547
BUILD_TOPLEVEL="$(cd ..; pwd -P)"

0 commit comments

Comments
 (0)