Skip to content

Commit

Permalink
Bump our language requirements to gnu11 & gnu++17
Browse files Browse the repository at this point in the history
.. this is supported in buster (gcc8) and newer
  • Loading branch information
jepler committed Aug 24, 2022
1 parent be2f84e commit 5446431
Show file tree
Hide file tree
Showing 6 changed files with 1,089 additions and 141 deletions.
10 changes: 4 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -245,17 +245,15 @@ INCLUDE += $(LIBTIRPC_CFLAGS)
INTEGER_OVERFLOW_FLAGS := -fwrapv
OPT := -Os $(INTEGER_OVERFLOW_FLAGS)
DEBUG := $(DEBUG) -g -Wall -Wno-stringop-truncation
CFLAGS := $(INCLUDE) $(OPT) $(DEBUG) $(EXTRA_DEBUG) -DULAPI -std=gnu99 -fgnu89-inline -Werror=implicit-function-declaration $(CFLAGS) $(CPPFLAGS)
CXXFLAGS := $(INCLUDE) $(EXTRA_DEBUG) -DULAPI $(DEBUG) $(OPT) -Woverloaded-virtual $(CXXFLAGS) $(CPPFLAGS)
CXXFLAGS += $(call cxx-option, -Wno-psabi)
CXXFLAGS += $(call cxx-option, -std=gnu++11, -std=gnu++0x)
CFLAGS := $(INCLUDE) $(OPT) $(DEBUG) $(EXTRA_DEBUG) -DULAPI -std=gnu11 -Werror=implicit-function-declaration $(CFLAGS) $(CPPFLAGS)
CXXFLAGS := $(INCLUDE) $(EXTRA_DEBUG) -DULAPI $(DEBUG) $(OPT) -Werror=overloaded-virtual $(CXXFLAGS) $(CPPFLAGS)
CXXFLAGS += -std=gnu++17
# In Debian 11, any inclusion of <boost/python.hpp> leads to several
# diagnostics from included headers about deprecated features. LinuxCNC does
# not directly use these deprecated features, but it does use boost::python.
# Silence the warnings just when they occur in files using boost/python.hpp by
# adding SILENCE_BOOST_INTERNAL_DIAGNOSTICS_FLAGS to the object's EXTRAFLAGS
SILENCE_BOOST_INTERNAL_DIAGNOSTICS_FLAGS = -DBOOST_ALLOW_DEPRECATED_HEADERS=1 -DBOOST_BIND_GLOBAL_PLACEHOLDERS=1

CFLAGS += $(TOOL_NML_FLAG)
CXXFLAGS += $(TOOL_NML_FLAG)

Expand Down Expand Up @@ -877,7 +875,7 @@ EXTRA_CFLAGS := $(filter-out -ffast-math,$(RTFLAGS)) -D__MODULE__ -I$(BASEPWD)/.
-I$(BASEPWD)/emc/nml_intf -I$(BASEPWD)/emc/kinematics -I$(BASEPWD)/emc/tp -I$(BASEPWD)/emc/motion \
-DSEQUENTIAL_SUPPORT -DHAL_SUPPORT -DDYNAMIC_PLCSIZE -DRT_SUPPORT -DOLD_TIMERS_MONOS_SUPPORT -DMODBUS_IO_MASTER \
-fno-fast-math $(call cc-option,-mieee-fp) -fno-unsafe-math-optimizations \
-Wframe-larger-than=2560 -Wno-declaration-after-statement \
-Werror=frame-larger-than=2560 -Wno-declaration-after-statement \
$(INTEGER_OVERFLOW_FLAGS)
ifneq ($(KERNELRELEASE),)
ifeq ($(RTARCH):$(RTAI):$(filter $(RTFLAGS),-msse),x86_64:3:)
Expand Down
6 changes: 4 additions & 2 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ fi
AC_PROG_CXX
AC_PROG_INSTALL

m4_include([m4/ax_cxx_compile_stdcxx_11.m4])
m4_include([m4/ax_require_defined.m4])
m4_include([m4/ax_cxx_compile_stdcxx.m4])
m4_include([m4/ax_cxx_compile_stdcxx_17.m4])
m4_include([m4/ax_python.m4])
m4_include([m4/ax_python_devel.m4])
m4_include([m4/ax_boost_base.m4])
m4_include([m4/ax_boost_python.m4])
# make this optional - it will likely only result in warnings
AX_CXX_COMPILE_STDCXX_11(noext,optional)
AX_CXX_COMPILE_STDCXX_17(ext,mandatory)

AC_MSG_CHECKING(build toplevel)
BUILD_TOPLEVEL="$(cd ..; pwd -P)"
Expand Down
Loading

0 comments on commit 5446431

Please sign in to comment.