Skip to content

Commit 5baa845

Browse files
committed
πŸ‘·β€β™€οΈ String ops and array bounds failure protection
1 parent ddb5484 commit 5baa845

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

β€ŽCMakeLists.txtβ€Ž

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ if(ZTD_ENCODING_TABLES_IS_TOP_LEVEL_PROJECT)
166166
${--warn-errors}
167167
)
168168
endif()
169-
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
169+
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14.0)
170170
# this stuff is, unfortunately, really poisonous and poorly implemented
171171
# in these GCC versions
172172
# (Wstringop-overflow) - [meta-bug] bogus/missing -Wstringop-overflow warnings
@@ -175,14 +175,11 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSI
175175
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100395
176176
# [10 Regression] spurious -Wstringop-overflow writing to a trailing array plus offset
177177
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353
178-
check_compiler_diagnostic(stringop-overflow)
179-
check_compiler_diagnostic(stringop-overread)
180-
check_compiler_diagnostic(array-bounds)
181178
target_compile_options(ztd.encoding_tables
182179
PUBLIC
183-
${--allow-stringop-overflow}
184-
${--allow-stringop-overread}
185-
${--allow-array-bounds})
180+
-Wstringop-overflow
181+
-Wstringop-overread
182+
-Warray-bounds
186183
endif()
187184

188185

0 commit comments

Comments
Β (0)