Skip to content

Commit

Permalink
Update various bits to c++17 and gnu++17. (#28280)
Browse files Browse the repository at this point in the history
A number of gnu++14/c++14/c++11/gnu++11 got missed.
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Dec 11, 2023
1 parent c4682bb commit 1204227
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 31 deletions.
16 changes: 8 additions & 8 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.gcc.json",
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -17,7 +17,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.clang.json",
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -29,7 +29,7 @@
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.mbedtls.json",
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-x64",
"browse": {
"path": ["${workspaceFolder}/out/debug/"],
Expand All @@ -39,7 +39,7 @@
{
"name": "Android x64 debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-x64",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.android_x64.json",
"compilerPath": "/opt/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android24-clang",
Expand All @@ -51,7 +51,7 @@
{
"name": "Android arm64 debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "clang-arm64",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.android_arm64.json",
"compilerPath": "/opt/android/android-ndk-r21b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang",
Expand All @@ -63,7 +63,7 @@
{
"name": "EFR32 examples debug (GN)",
"cStandard": "c11",
"cppStandard": "c++11",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.efr32.json",
"compilerPath": "/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc",
Expand All @@ -75,7 +75,7 @@
{
"name": "nRF Connect examples debug (GN)",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compilerPath": "/opt/ARM-software/gcc-arm-none-eabi-9-2019-q4-major/bin/arm-none-eabi-gcc",
"browse": {
Expand All @@ -86,7 +86,7 @@
{
"name": "Tizen examples debug (GN)",
"cStandard": "c11",
"cppStandard": "gnu++14",
"cppStandard": "gnu++17",
"intelliSenseMode": "gcc-arm",
"compilerPath": "/opt/tizen-sdk/tools/arm-linux-gnueabi-gcc-9.2/bin/arm-linux-gnueabi-gcc",
"compileCommands": "${workspaceFolder}/out/debug/compile_commands.tizen_arm.json",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
],
"clang-format.fallbackStyle": "WebKit",
"files.trimFinalNewlines": true,
"C_Cpp.default.cppStandard": "gnu++14",
"C_Cpp.default.cppStandard": "gnu++17",
"C_Cpp.default.cStandard": "gnu11",
"cmake.configureOnOpen": false,
"search.followSymlinks": false,
Expand Down
3 changes: 1 addition & 2 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
3 changes: 1 addition & 2 deletions examples/all-clusters-minimal-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(EXTRA_COMPONENT_DIRS

# TODO: add CHIPProjectAppConfig.h to esp32
project(chip-bridge-app)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H;-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-DCHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT=16" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
Expand Down
3 changes: 1 addition & 2 deletions examples/chef/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
3 changes: 1 addition & 2 deletions examples/light-switch-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
3 changes: 1 addition & 2 deletions examples/lighting-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 1 addition & 1 deletion examples/ota-provider-app/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set(EXTRA_COMPONENT_DIRS
)

project(chip-ota-provider-app)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
Expand Down
3 changes: 1 addition & 2 deletions examples/ota-requestor-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ list(
APPEND chip_main_cpp_flags

-Wno-unused-parameter
-std=gnu++11
-std=c++14
-std=c++17
-fno-rtti
)
target_compile_definitions(${chip_main} PRIVATE ${chip_main_flags} )
Expand Down
2 changes: 1 addition & 1 deletion examples/persistent-storage/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set(EXTRA_COMPONENT_DIRS
)

project(chip-persistent-storage)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
# For the C3, project_include.cmake sets -Wno-format, but does not clear various
# flags that depend on -Wformat
Expand Down
2 changes: 1 addition & 1 deletion examples/shell/esp32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set(EXTRA_COMPONENT_DIRS
)

project(chip-shell)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)

# For the C3, project_include.cmake sets -Wno-format, but does not clear various
Expand Down
4 changes: 2 additions & 2 deletions src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -508,7 +508,7 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down
4 changes: 2 additions & 2 deletions src/darwin/Framework/Matter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1686,7 +1686,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down Expand Up @@ -1858,7 +1858,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
Expand Down
2 changes: 1 addition & 1 deletion third_party/ti_simplelink_sdk/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ config("ti_simplelink_freertos_config") {
config("ti_simplelink_posix_config") {
include_dirs = [ "${ti_simplelink_sdk_root}/source/ti/posix/gcc" ]
cflags_c = [ "-std=c11" ]
cflags_cc = [ "-std=c++14" ]
cflags_cc = [ "-std=c++17" ]
cflags = [
"-Wno-maybe-uninitialized",
"-Wno-sign-compare",
Expand Down
2 changes: 1 addition & 1 deletion third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ template("ti_simplelink_sdk") {
config("${sdk_target_name}_posix_config") {
include_dirs = [ "${ti_simplelink_sdk_root}/source/ti/posix/gcc" ]
cflags_c = [ "-std=c11" ]
cflags_cc = [ "-std=c++14" ]
cflags_cc = [ "-std=c++17" ]
cflags = [
"-Wno-maybe-uninitialized",
"-Wno-sign-compare",
Expand Down

0 comments on commit 1204227

Please sign in to comment.