From 67324e6f593a95fdec8a8de50c10a5d368348e0c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 26 Jul 2023 00:46:22 -0400 Subject: [PATCH] Update various bits to c++17 and gnu++17. (#28280) A number of gnu++14/c++14/c++11/gnu++11 got missed. --- .vscode/c_cpp_properties.json | 16 ++++++++-------- .vscode/settings.json | 2 +- examples/all-clusters-app/ameba/chip_main.cmake | 3 +-- .../ameba/chip_main.cmake | 3 +-- examples/bridge-app/esp32/CMakeLists.txt | 2 +- examples/chef/ameba/chip_main.cmake | 3 +-- examples/light-switch-app/ameba/chip_main.cmake | 3 +-- examples/lighting-app/ameba/chip_main.cmake | 3 +-- examples/ota-provider-app/esp32/CMakeLists.txt | 2 +- examples/ota-requestor-app/ameba/chip_main.cmake | 3 +-- examples/persistent-storage/esp32/CMakeLists.txt | 2 +- examples/shell/esp32/CMakeLists.txt | 2 +- .../CHIPTool/CHIPTool.xcodeproj/project.pbxproj | 4 ++-- .../Framework/Matter.xcodeproj/project.pbxproj | 4 ++-- third_party/ti_simplelink_sdk/BUILD.gn | 2 +- .../ti_simplelink_sdk/ti_simplelink_sdk.gni | 2 +- 16 files changed, 25 insertions(+), 31 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 425b49fdf84ae3..ef2ff751283ba9 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -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/"], @@ -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/"], @@ -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/"], @@ -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", @@ -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", @@ -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", @@ -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": { @@ -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", diff --git a/.vscode/settings.json b/.vscode/settings.json index e1a1725bcfbadb..7524bf25d83ec2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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, diff --git a/examples/all-clusters-app/ameba/chip_main.cmake b/examples/all-clusters-app/ameba/chip_main.cmake index 77bea5ccfe132f..9aa14765fa7923 100755 --- a/examples/all-clusters-app/ameba/chip_main.cmake +++ b/examples/all-clusters-app/ameba/chip_main.cmake @@ -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} ) diff --git a/examples/all-clusters-minimal-app/ameba/chip_main.cmake b/examples/all-clusters-minimal-app/ameba/chip_main.cmake index 95b062a636f0a6..6eed28e5dec0da 100755 --- a/examples/all-clusters-minimal-app/ameba/chip_main.cmake +++ b/examples/all-clusters-minimal-app/ameba/chip_main.cmake @@ -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} ) diff --git a/examples/bridge-app/esp32/CMakeLists.txt b/examples/bridge-app/esp32/CMakeLists.txt index 1e7c544310462c..d5a5732e145274 100644 --- a/examples/bridge-app/esp32/CMakeLists.txt +++ b/examples/bridge-app/esp32/CMakeLists.txt @@ -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 diff --git a/examples/chef/ameba/chip_main.cmake b/examples/chef/ameba/chip_main.cmake index c92f1e0b471eb0..bc4ef4a9308bc1 100755 --- a/examples/chef/ameba/chip_main.cmake +++ b/examples/chef/ameba/chip_main.cmake @@ -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} ) diff --git a/examples/light-switch-app/ameba/chip_main.cmake b/examples/light-switch-app/ameba/chip_main.cmake index 23d8d66feea2d4..71deaa9938e494 100755 --- a/examples/light-switch-app/ameba/chip_main.cmake +++ b/examples/light-switch-app/ameba/chip_main.cmake @@ -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} ) diff --git a/examples/lighting-app/ameba/chip_main.cmake b/examples/lighting-app/ameba/chip_main.cmake index 5d8b85dd1e6a14..727b7e4d554868 100755 --- a/examples/lighting-app/ameba/chip_main.cmake +++ b/examples/lighting-app/ameba/chip_main.cmake @@ -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} ) diff --git a/examples/ota-provider-app/esp32/CMakeLists.txt b/examples/ota-provider-app/esp32/CMakeLists.txt index d9abb2fe27f3d3..156c9366e183b1 100644 --- a/examples/ota-provider-app/esp32/CMakeLists.txt +++ b/examples/ota-provider-app/esp32/CMakeLists.txt @@ -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 diff --git a/examples/ota-requestor-app/ameba/chip_main.cmake b/examples/ota-requestor-app/ameba/chip_main.cmake index a7aecb06707370..ed14a6424eab40 100644 --- a/examples/ota-requestor-app/ameba/chip_main.cmake +++ b/examples/ota-requestor-app/ameba/chip_main.cmake @@ -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} ) diff --git a/examples/persistent-storage/esp32/CMakeLists.txt b/examples/persistent-storage/esp32/CMakeLists.txt index 372d88c2729db1..86bf87b7a4a4d5 100644 --- a/examples/persistent-storage/esp32/CMakeLists.txt +++ b/examples/persistent-storage/esp32/CMakeLists.txt @@ -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 diff --git a/examples/shell/esp32/CMakeLists.txt b/examples/shell/esp32/CMakeLists.txt index 1b1c919acef6ee..3b23f33624aeb6 100644 --- a/examples/shell/esp32/CMakeLists.txt +++ b/examples/shell/esp32/CMakeLists.txt @@ -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 diff --git a/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj b/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj index a7993016697d66..67692af8f88bc4 100644 --- a/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj +++ b/src/darwin/CHIPTool/CHIPTool.xcodeproj/project.pbxproj @@ -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; @@ -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; diff --git a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj index ba81628e65a01a..8dc126d5e24f2a 100644 --- a/src/darwin/Framework/Matter.xcodeproj/project.pbxproj +++ b/src/darwin/Framework/Matter.xcodeproj/project.pbxproj @@ -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; @@ -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; diff --git a/third_party/ti_simplelink_sdk/BUILD.gn b/third_party/ti_simplelink_sdk/BUILD.gn index 8f6c4806d2182a..363d94685955fe 100644 --- a/third_party/ti_simplelink_sdk/BUILD.gn +++ b/third_party/ti_simplelink_sdk/BUILD.gn @@ -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", diff --git a/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni b/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni index 08ef9bd1c6fd8a..06c925ff8b0774 100644 --- a/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni +++ b/third_party/ti_simplelink_sdk/ti_simplelink_sdk.gni @@ -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",