Skip to content

Commit 0bb5c10

Browse files
linesightclaude
andcommitted
build: suppress false-positive -Wstringop-overflow warnings with GCC LTO on Linux
GCC's alias analysis loses track of object sizes when small ref-counted classes are inlined across translation units during LTO, triggering spurious -Wstringop-overflow warnings on the atomic ref_count_ write. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent a68d6b1 commit 0bb5c10

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ else()
225225
target_compile_options(${MODULE_NAME} PRIVATE
226226
-DNDEBUG -O3
227227
-flto -fdata-sections -ffunction-sections
228+
-Wno-stringop-overflow
228229
)
229230
target_compile_definitions(${MODULE_NAME} PRIVATE
230231
BROWSER_PROCESS

src/client_handler/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ elseif(APPLE)
5757
target_compile_definitions(client_handler PRIVATE
5858
CEFPYTHON_API_H_FILE="cefpython_api_fixed.h")
5959
else()
60-
target_compile_options(client_handler PRIVATE -DNDEBUG -O3)
60+
target_compile_options(client_handler PRIVATE -DNDEBUG -O3 -Wno-stringop-overflow)
6161
target_compile_definitions(client_handler PRIVATE
6262
CEFPYTHON_API_H_FILE="cefpython_api_fixed.h")
6363
endif()

src/cpp_utils/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ elseif(APPLE)
2424
target_compile_definitions(cpp_utils PRIVATE
2525
CEFPYTHON_API_H_FILE="cefpython_api_fixed.h")
2626
else()
27-
target_compile_options(cpp_utils PRIVATE -DNDEBUG -O3)
27+
target_compile_options(cpp_utils PRIVATE -DNDEBUG -O3 -Wno-stringop-overflow)
2828
target_compile_definitions(cpp_utils PRIVATE
2929
CEFPYTHON_API_H_FILE="cefpython_api_fixed.h")
3030
endif()

0 commit comments

Comments
 (0)