Remove --std=c++11 as the default c++ version #1700

Removed --std=c++11 from makefiles and where it would be added to
generated makefiles.
This commit is contained in:
Alex Lin 2024-04-26 08:06:07 -05:00
parent e4f6774b3c
commit ff9bfcc6f1
26 changed files with 28 additions and 28 deletions

View File

@ -32,7 +32,7 @@ sub read_files_to_process() {
# Prepend -I to each include path before we pass them to the compiler
my @include_paths = map("-I$_", (get_include_paths(), "$ENV{TRICK_HOME}/include", "$ENV{TRICK_HOME}/include/trick/compat", "$ENV{TRICK_HOME}/trick_source", "../include")) ;
my @defines = (get_defines(), "-DTRICK_VER=$year", "-DSWIG", "-std=c++11") ;
my @defines = (get_defines(), "-DTRICK_VER=$year", "-DSWIG") ;
# get the list of header files from the compiler
open FILE_LIST, "$cc -MM @include_paths @defines S_source.hh |" ;

View File

@ -96,7 +96,7 @@ $(TRICK_LIB_DIR):
$(IO_C_OBJS): $(OBJ_DIR)/%.o : $(IO_SRC_DIR)%.c | $(OBJ_DIR)
$(TRICK_CC) $(TRICK_CFLAGS) $(TRICK_SYSTEM_CFLAGS) -c $< -o $@
$(IO_CPP_OBJS): TRICK_SYSTEM_CXXFLAGS += -std=c++11
$(IO_CPP_OBJS): TRICK_SYSTEM_CXXFLAGS +=
$(IO_CPP_OBJS): TRICK_SYSTEM_CXXFLAGS += -Wno-invalid-offsetof
ifeq ($(IS_CC_CLANG), 0)
# cannot get an "expr" command to work on all platforms. Falling back to reliable perl. :)

View File

@ -61,5 +61,5 @@ ifeq "" "c++11"
TRICK_ADDITIONAL_CXXFLAGS += -std=c++11 -D_HAVE_STL_RANDOM
endif
TRICK_ADDITIONAL_TEST_FLAGS += -std=c++11
TRICK_ADDITIONAL_TEST_FLAGS +=

View File

@ -135,7 +135,7 @@ $(dir $(TRICKIFY_OBJECT_NAME)) $(BUILD_DIR) $(dir $(TRICKIFY_PYTHON_DIR)) .trick
$(IO_OBJECTS): %.o: %.cpp
$(info $(call COLOR,Compiling) $<)
$(call ECHO_AND_LOG,$(TRICK_CXX) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -std=c++11 -Wno-invalid-offsetof -MMD -MP -c -o $@ $<)
$(call ECHO_AND_LOG,$(TRICK_CXX) $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS) -Wno-invalid-offsetof -MMD -MP -c -o $@ $<)
$(IO_OBJECTS:.o=.d): %.d: ;

View File

@ -1 +1 @@
TRICK_CXXFLAGS += -Imodels -std=c++11
TRICK_CXXFLAGS += -Imodels

View File

@ -1,3 +1,3 @@
TRICK_CFLAGS += -I./models
TRICK_CXXFLAGS += -I./models -std=c++11
TRICK_CXXFLAGS += -I./models

View File

@ -1,3 +1,3 @@
TRICK_CFLAGS += -I./models
TRICK_CXXFLAGS += -I./models -std=c++11
TRICK_CXXFLAGS += -I./models

View File

@ -1,5 +1,5 @@
TRICK_CFLAGS += -g -Wall -Wextra
TRICK_CXXFLAGS += -g -std=c++11 -Wall -Wextra
TRICK_CXXFLAGS += -g -Wall -Wextra
# We can't yet make warnings to be errors on MacOS, because
# MACOS deprecates and warns about sprintf. But SWIG
# still generates code containing sprintf..

View File

@ -2,7 +2,7 @@
TRICK_CFLAGS += -I./models
TRICK_CXXFLAGS += -I./models
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=
clean: checkpoint_clean

View File

@ -439,11 +439,11 @@ void PrintAttributes::printIOMakefile() {
<< "ifeq ($(IS_CC_CLANG), 0)" << std::endl
<< " TRICK_IO_CXXFLAGS += -Wno-unused-local-typedefs -Wno-unused-but-set-variable" << std::endl
<< " ifeq ($(shell test $(GCC_MAJOR) -lt 6; echo $$?), 0)" << std::endl
<< " TRICK_IO_CXXFLAGS += -std=c++11" << std::endl
<< " TRICK_IO_CXXFLAGS +=" << std::endl
<< " endif" << std::endl
<< "endif" << std::endl
<< "ifeq ($(IS_CC_CLANG), 1)" << std::endl
<< " TRICK_IO_CXXFLAGS += -std=c++14" << std::endl
<< " TRICK_IO_CXXFLAGS +=" << std::endl
<< "endif" << std::endl
<< std::endl
<< "IO_OBJECTS =" ;

View File

@ -19,7 +19,7 @@ else
ifeq ($(CLANG_MAJOR_GTEQ10),1)
CXXFLAGS += -std=c++14
else
CXXFLAGS += -std=c++11
CXXFLAGS +=
endif
endif

View File

@ -4,7 +4,7 @@
TRICK_HOME := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../..)
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=
include ${TRICK_HOME}/share/trick/makefiles/Makefile.common

View File

@ -11,7 +11,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../../share/trick/makefiles/Mak
TRICK_SYSTEM_CXXFLAGS := $(subst -isystem,-I,$(TRICK_SYSTEM_CXXFLAGS))
# Flags passed to the preprocessor.
TRICK_CXXFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -std=c++11 ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_TEST_FLAGS}
TRICK_CXXFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_TEST_FLAGS}
# so it seems like there's some weirdness linking in the bitfield objects since they are C
MM_OBJECTS = $(TRICK_HOME)/trick_source/sim_services/MemoryManager/object_${TRICK_HOST_CPU}/extract_bitfield.o \

View File

@ -2,7 +2,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../share/trick/makefiles/Makefi
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
-include Makefile_deps
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=
ifneq ($(HDF5),)
ifneq ($(HDF5),/usr)

View File

@ -2,4 +2,4 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../share/trick/makefiles/Makefi
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
-include Makefile_deps
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=

View File

@ -3,7 +3,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
-include Makefile_deps
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=
ifeq ($(HAVE_GSL),1)
TRICK_CXXFLAGS += -D_HAVE_GSL

View File

@ -1,4 +1,4 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../share/trick/makefiles/Makefile.common
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=
-include Makefile_deps

View File

@ -2,4 +2,4 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../share/trick/makefiles/Makefi
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
-include Makefile_deps
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=

View File

@ -1,4 +1,4 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../share/trick/makefiles/Makefile.common
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
-include Makefile_deps
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=

View File

@ -1,4 +1,4 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../../../share/trick/makefiles/Makefile.common
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
-include Makefile_deps
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=

View File

@ -11,7 +11,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../../../../share/trick/makefiles/Mak
TRICK_SYSTEM_CXXFLAGS := $(subst -isystem,-I,$(TRICK_SYSTEM_CXXFLAGS)) -Wno-unused-command-line-argument
# Flags passed to the preprocessor.
TRICK_CXXFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -Wno-sign-compare -std=c++11 ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_TEST_FLAGS}
TRICK_CXXFLAGS += -I$(GTEST_HOME)/include -I$(TRICK_HOME)/include -g -Wall -Wextra -Wno-sign-compare ${TRICK_SYSTEM_CXXFLAGS} ${TRICK_TEST_FLAGS}
TRICK_LIBS = -L${TRICK_LIB_DIR} -ltrick_mm -ltrick_units -ltrick_comm -ltrick_pyip -ltrick -ltrick_mm -ltrick_units -ltrick_comm -ltrick_pyip -ltrick -ltrick_var_binary_parser -ltrick_connection_handlers -ltrick_comm
TRICK_EXEC_LINK_LIBS += -L${GTEST_HOME}/lib64 -L${GTEST_HOME}/lib -lgtest -lgtest_main -lgmock -lpthread
@ -93,4 +93,4 @@ code-coverage: test
clean :
rm -f $(TESTS)
rm -f *.gcno *.gcda
rm -rf io_src xml obj
rm -rf io_src xml obj

View File

@ -25,7 +25,7 @@ PY_FILES = \
${TRICK_HOME}/share/trick/swig/swig_ref.py
SWIG_SRC_FILES = $(addprefix swig_${TRICK_HOST_CPU}/, $(notdir $(subst .o,.cpp,$(SWIG_OBJECT_FILES))))
TRICK_CXXFLAGS += $(PYTHON_INCLUDES) -Wno-redundant-decls -Wno-shadow -Wno-unused-parameter -Wno-missing-field-initializers -std=c++11
TRICK_CXXFLAGS += $(PYTHON_INCLUDES) -Wno-redundant-decls -Wno-shadow -Wno-unused-parameter -Wno-missing-field-initializers
ifeq ($(IS_CC_CLANG), 1)
TRICK_CXXFLAGS += -Wno-self-assign -Wno-sometimes-uninitialized

View File

@ -3,7 +3,7 @@ RM = rm -rf
CC = cc
CPP = c++
CFLAGS = -g -Wall -std=c++11 ${TRICK_CXXFLAGS}
CFLAGS = -g -Wall ${TRICK_CXXFLAGS}
INCLUDE_DIRS = -Iinclude
OBJDIR = obj
LIBDIR = lib

View File

@ -9,7 +9,7 @@ TRICK_LIB := $(TRICK_LIB_DIR)/libtrick_connection_handlers.a
include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
-include Makefile_deps
TRICK_CXXFLAGS += -std=c++11
TRICK_CXXFLAGS +=
# make the comm library when called by the master makefile.
trick: ${TRICK_LIB}

View File

@ -6,7 +6,7 @@ include ${TRICK_HOME}/share/trick/makefiles/Makefile.common
#include ${TRICK_HOME}/share/trick/makefiles/Makefile.tricklib
CPP_FLAGS = -g -Wall -Wextra -std=c++11 $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS)
CPP_FLAGS = -g -Wall -Wextra $(TRICK_CXXFLAGS) $(TRICK_SYSTEM_CXXFLAGS)
INCLUDE_DIRS = -I${TRICK_HOME}/include
OBJDIR = obj
LIBDIR = lib

View File

@ -9,7 +9,7 @@ CP = cp
MKDIR = mkdir
CFLAGS = -g -Wall
CPPFLAGS = -g -Wall -std=c++11
CPPFLAGS = -g -Wall
INCLUDE_DIRS = -I${PWD}/include -I${CIVETWEB_HOME}/include -I${TRICK_HOME}/include