update C++ standard (c++11 -> c++14)

- temporarily disable snapdragon builds until toolchain is updated
This commit is contained in:
Daniel Agar
2020-01-21 21:49:10 -05:00
committed by GitHub
parent cf195b0755
commit b47eaa6061
10 changed files with 17 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ pipeline {
] ]
def docker_builds = [ def docker_builds = [
armhf_builds, base_builds, nuttx_builds_archive, snapdragon_builds armhf_builds, base_builds, nuttx_builds_archive//, snapdragon_builds
] ]
for (def build_type = 0; build_type < docker_builds.size(); build_type++) { for (def build_type = 0; build_type < docker_builds.size(); build_type++) {

View File

@@ -56,8 +56,8 @@
"cortex-debug.enableTelemetry": false, "cortex-debug.enableTelemetry": false,
"C_Cpp.clang_format_fallbackStyle": "none", "C_Cpp.clang_format_fallbackStyle": "none",
"C_Cpp.configurationWarnings": "Disabled", "C_Cpp.configurationWarnings": "Disabled",
"C_Cpp.default.cppStandard": "c++11", "C_Cpp.default.cppStandard": "c++14",
"C_Cpp.default.cStandard": "c99", "C_Cpp.default.cStandard": "c11",
"C_Cpp.default.intelliSenseMode": "gcc-x64", "C_Cpp.default.intelliSenseMode": "gcc-x64",
"C_Cpp.errorSquiggles": "Disabled", "C_Cpp.errorSquiggles": "Disabled",
"C_Cpp.formatting": "Disabled", "C_Cpp.formatting": "Disabled",

View File

@@ -51,8 +51,8 @@ flags = [
# headers will be compiled as C headers. You don't want that so ALWAYS specify # headers will be compiled as C headers. You don't want that so ALWAYS specify
# a "-std=<something>". # a "-std=<something>".
# For a C project, you would set this to something like 'c99' instead of # For a C project, you would set this to something like 'c99' instead of
# 'c++11'. # 'c++14'.
'-std=c++11', '-std=c++14',
# ...and the same thing goes for the magic -x option which specifies the # ...and the same thing goes for the magic -x option which specifies the
# language that the files to be compiled are written in. This is mostly # language that the files to be compiled are written in. This is mostly
# relevant for c++ headers. # relevant for c++ headers.

View File

@@ -191,7 +191,7 @@ project(px4 CXX C ASM)
set(package-contact "px4users@googlegroups.com") set(package-contact "px4users@googlegroups.com")
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON) set(CMAKE_C_STANDARD_REQUIRED ON)

View File

@@ -437,7 +437,7 @@ clang-tidy-quiet: px4_sitl_default-clang
# TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all # TODO: Fix cppcheck errors then try --enable=warning,performance,portability,style,unusedFunction or --enable=all
cppcheck: px4_sitl_default cppcheck: px4_sitl_default
@mkdir -p "$(SRC_DIR)"/build/cppcheck @mkdir -p "$(SRC_DIR)"/build/cppcheck
@cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++11 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null @cppcheck -i"$(SRC_DIR)"/src/examples --enable=performance --std=c++14 --std=c99 --std=posix --project="$(SRC_DIR)"/build/px4_sitl_default/compile_commands.json --xml-version=2 2> "$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml > /dev/null
@cppcheck-htmlreport --source-encoding=ascii --file="$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml --report-dir="$(SRC_DIR)"/build/cppcheck --source-dir="$(SRC_DIR)"/src/ @cppcheck-htmlreport --source-encoding=ascii --file="$(SRC_DIR)"/build/cppcheck/cppcheck-result.xml --report-dir="$(SRC_DIR)"/build/cppcheck --source-dir="$(SRC_DIR)"/src/
shellcheck_all: shellcheck_all:

View File

@@ -38,15 +38,15 @@ project(micrortps_agent)
find_package(fastrtps REQUIRED) find_package(fastrtps REQUIRED)
find_package(fastcdr REQUIRED) find_package(fastcdr REQUIRED)
# Set C++11 # Set C++14
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
CMAKE_CXX_COMPILER_ID MATCHES "Clang") CMAKE_CXX_COMPILER_ID MATCHES "Clang")
check_cxx_compiler_flag(--std=c++11 SUPPORTS_CXX11) check_cxx_compiler_flag(--std=c++14 SUPPORTS_CXX14)
if(SUPPORTS_CXX11) if(SUPPORTS_CXX11)
add_compile_options(--std=c++11) add_compile_options(--std=c++14)
else() else()
message(FATAL_ERROR "Compiler doesn't support C++11") message(FATAL_ERROR "Compiler doesn't support C++14")
endif() endif()
endif() endif()

View File

@@ -109,7 +109,7 @@ CFLAGS = $(ARCHINCLUDES) \
-Wno-type-limits -Wno-type-limits
CXXFLAGS = $(ARCHXXINCLUDES) \ CXXFLAGS = $(ARCHXXINCLUDES) \
-std=gnu++11 \ -std=c++14 \
-nostdinc++ \ -nostdinc++ \
${CMAKE_CXX_FLAGS} \ ${CMAKE_CXX_FLAGS} \
$(FLAGS) \ $(FLAGS) \
@@ -117,6 +117,7 @@ CXXFLAGS = $(ARCHXXINCLUDES) \
-fno-builtin \ -fno-builtin \
-fno-exceptions \ -fno-exceptions \
-fno-rtti \ -fno-rtti \
-fno-sized-deallocation \
-nostdinc++ \ -nostdinc++ \
-Wno-double-promotion \ -Wno-double-promotion \
-Wno-missing-declarations -Wno-missing-declarations

View File

@@ -67,6 +67,8 @@ function(px4_os_add_flags)
# prevent using the toolchain's std c++ library # prevent using the toolchain's std c++ library
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>) add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-nostdinc++>)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-sized-deallocation>)
add_definitions( add_definitions(
-D__PX4_NUTTX -D__PX4_NUTTX

View File

@@ -2,6 +2,7 @@ include_directories(
./include ./include
) )
add_compile_options(-Wno-unused-variable)
add_library(uavcan_kinetis_driver STATIC add_library(uavcan_kinetis_driver STATIC
./src/uc_kinetis_flexcan.cpp ./src/uc_kinetis_flexcan.cpp
./src/uc_kinetis_clock.cpp ./src/uc_kinetis_clock.cpp

View File

@@ -693,7 +693,7 @@ void CanIface::handleRxInterrupt(uavcan::uint32_t rx_iflags, uavcan::uint64_t ut
frame.data[7] = rf.data.b7; frame.data[7] = rf.data.b7;
volatile uavcan::uint32_t idhit = can_->RXFIR; volatile uavcan::uint32_t idhit = can_->RXFIR;
UNUSED(idhit);
(void)can_->TIMER; (void)can_->TIMER;
can_->IFLAG1 = flexcan::CAN_FIFO_NE; can_->IFLAG1 = flexcan::CAN_FIFO_NE;