Skip to content

Commit

Permalink
馃洜 Continue to fight off terrible-by-default GNU Warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Dec 24, 2022
1 parent 07d1109 commit 9af1129
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ if(ZTD_TEXT_IS_TOP_LEVEL_PROJECT)
set(CMAKE_C_STANDARD 11)
endif()

set(CMAKE_OBJECT_PATH_MAX 1024)

if(ZTD_TEXT_BENCHMARKS OR ZTD_TEXT_EXAMPLES OR ZTD_TEXT_TESTS OR ZTD_TEXT_SCRATCH)
# normal flags
check_compiler_flag(disable-permissive MSVC /permissive- GCC -pedantic)
Expand All @@ -117,6 +119,7 @@ if(ZTD_TEXT_IS_TOP_LEVEL_PROJECT)
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
check_compiler_diagnostic(stringop-overflow)
check_compiler_diagnostic(stringop-overread)
check_compiler_diagnostic(array-bounds)
endif()
endif()
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/barrier/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ target_compile_options(ztd.text.benchmarks.barrier
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_link_libraries(ztd.text.benchmarks.barrier
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/conversion_speed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function (generate_converion_speed_benchmark_targets name data_name title)
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_compile_definitions(ztd.text.benchmarks.conversion_speed.${name}
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/function_form/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function (generate_function_form_benchmark_targets name data_name title)
${--warn-all}
${--warn-extra}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
# MSVC is BROKEN
# ${--warn-errors}
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ foreach (example_source_name ${ztd.text.examples.basic.sources})
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
${--allow-bit-int-extension}
)
Expand Down
2 changes: 1 addition & 1 deletion examples/boost.text/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ target_compile_options(ztd.text.examples.boost_text
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)

Expand Down
2 changes: 1 addition & 1 deletion examples/documentation/compile_fails/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ foreach (example_name ${ztd.text.examples.documentation.compile_fails.sources})
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
set_target_properties(${example_target}
Expand Down
2 changes: 1 addition & 1 deletion examples/documentation/quick/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ foreach (example_source_name ${ztd.text.examples.documentation.quick.basic.sourc
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)

Expand Down
2 changes: 1 addition & 1 deletion examples/documentation/snippets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ foreach (example_source_name ${ztd.text.examples.documentation.snippets.sources}
${--warn-all}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_include_directories(${example_target}
Expand Down
2 changes: 1 addition & 1 deletion examples/shift_jis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ target_compile_options(ztd.text.examples.shift_jis
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_include_directories(ztd.text.examples.shift_jis
Expand Down
2 changes: 1 addition & 1 deletion tests/additional_encodings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ target_compile_options(ztd.text.tests.additional_encodings
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_include_directories(ztd.text.tests.additional_encodings
Expand Down
2 changes: 1 addition & 1 deletion tests/basic_compile_time/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ target_compile_options(ztd.text.tests.basic_compile_time
${--extra-constexpr-depth}
${--extra-constexpr-steps}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_include_directories(ztd.text.tests.basic_compile_time
Expand Down
2 changes: 1 addition & 1 deletion tests/basic_run_time/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ target_compile_options(ztd.text.tests.basic_run_time
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_include_directories(ztd.text.tests.basic_run_time
Expand Down
2 changes: 1 addition & 1 deletion tests/compile_fails/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ foreach (test_name ${ztd.text.tests.tests.compile_fails.sources})
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_link_libraries(${test_target}
Expand Down
2 changes: 1 addition & 1 deletion tests/iconv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ target_compile_options(ztd.text.tests.iconv
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_include_directories(ztd.text.tests.iconv
Expand Down
2 changes: 1 addition & 1 deletion tests/inclusion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ target_compile_options(ztd.text.tests.inclusion
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_link_libraries(ztd.text.tests.inclusion
Expand Down
2 changes: 1 addition & 1 deletion tests/tiny_buffer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ target_compile_options(ztd.text.tests.tiny_buffer
${--warn-extra}
${--warn-errors}
${--allow-alignas-extra-padding}
${--allow-stringop-overflow}
${--allow-stringop-overflow} ${--allow-stringop-overread}
${--allow-array-bounds}
)
target_include_directories(ztd.text.tests.tiny_buffer
Expand Down

0 comments on commit 9af1129

Please sign in to comment.