1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-23 12:57:07 +00:00

general: cmake: add ZINT_SANITIZEM (clang -fsanitize=memory) option

and suppress errors in lib and backend tests (pretty sure they're
  nearly all false positives apart from maybe 2 non-initializations
  in "gif.c" (`pOut` buffer) and "raster.c" (`rotated_pixbuf`)
github: install de_DE.UTF-8 locale in ubuntu-debug also
This commit is contained in:
gitlost
2025-02-19 01:15:58 +00:00
parent 33135fc146
commit c7cf006e71
38 changed files with 177 additions and 129 deletions

View File

@@ -88,6 +88,13 @@ else()
message(STATUS "Not using PNG")
endif()
# Incompatible with ZINT_SANITIZE (and also with ZINT_USE_PNG unless libpng instrumented)
if(NOT ZINT_SANITIZE AND ZINT_SANITIZEM AND CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer -O2)
link_libraries(-fsanitize=memory)
zint_target_compile_definitions(PRIVATE ZINT_SANITIZEM)
endif()
if(ZINT_TEST)
zint_target_compile_definitions(PUBLIC ZINT_TEST)
endif()