Updating build system to enforce C++11 standard.

This commit is contained in:
Ward Fisher 2024-01-17 17:14:46 -08:00
parent 2ad11d3c14
commit 764667fce6
4 changed files with 9 additions and 4 deletions

View File

@ -432,6 +432,8 @@ ENDIF()
#
# Also, set some other default compiler flags.
##
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_STANDARD_REQUIRED TRUE)
IF(CMAKE_COMPILER_IS_GNUCC OR APPLE)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-variable -Wno-unused-parameter")

View File

@ -175,6 +175,9 @@ AC_FUNC_MALLOC
# Check to see if any macros must be set to enable large (>2GB) files.
AC_SYS_LARGEFILE
# Set the CXXFLAGSS
CXXFLAGS="$CXXFLAGS --std=c++11"
# User supplied nc-config
AC_ARG_WITH([nc-config],
[AS_HELP_STRING([--with-nc-config=DIR],

View File

@ -1347,8 +1347,8 @@ map<string,NcGroup> NcGroup::getCoordVars(NcGroup::Location location) const {
// Get the NcDim and NcVar object pair for a named coordinate variables.
void NcGroup::getCoordVar(const string& coordVarName, NcDim& ncDim, NcVar& ncVar, NcGroup::Location location) const {
// Nullify existing dim/var in case no coordinate variable found
ncDim = NcDim();
ncVar = NcVar();
ncDim = NcDim{};
ncVar = NcVar{};
// search in current group and parent groups.
multimap<string,NcDim>::iterator itD;

View File

@ -39,8 +39,8 @@ int main()
cout <<left<<setw(55)<<"Testing addVar(\"dimensionName\")";
// Coordinate variables
NcVar var1 = ncFile.addVar("dim1", NcInt());
NcVar var4 = groupB.addVar("dim4", NcInt());
NcVar var1 = ncFile.addVar("dim1", NcInt{});
NcVar var4 = groupB.addVar("dim4", NcInt{});
cout <<" ----------- passed\n";
cout <<left<<setw(55)<<"Testing NcDim::isUnlimited()";