1
0
mirror of https://git.code.sf.net/p/zint/code synced 2025-12-18 02:17:06 +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

@@ -1869,8 +1869,8 @@ int testUtilCmpTxts(const char *txt1, const char *txt2) {
int ret = -1;
FILE *fp1;
FILE *fp2;
char buf1[1024];
char buf2[1024];
char buf1[1024] = {0}; /* Suppress clang -fsanitize=memory false positive */
char buf2[1024] = {0}; /* Suppress clang -fsanitize=memory false positive */
size_t len1 = 0, len2 = 0;
fp1 = testUtilOpen(txt1, "r");
@@ -1920,8 +1920,8 @@ int testUtilCmpBins(const char *bin1, const char *bin2) {
int ret = -1;
FILE *fp1;
FILE *fp2;
char buf1[1024];
char buf2[1024];
char buf1[1024] = {0}; /* Suppress clang -fsanitize=memory false positive */
char buf2[1024] = {0}; /* Suppress clang -fsanitize=memory false positive */
size_t len1 = 0, len2 = 0;
fp1 = testUtilOpen(bin1, "rb");
@@ -1970,8 +1970,8 @@ int testUtilCmpEpss(const char *eps1, const char *eps2) {
int ret = -1;
FILE *fp1;
FILE *fp2;
char buf1[1024];
char buf2[1024];
char buf1[1024] = {0}; /* Suppress clang -fsanitize=memory false positive */
char buf2[1024] = {0}; /* Suppress clang -fsanitize=memory false positive */
size_t len1 = 0, len2 = 0;
static char first_line[] = "%!PS-Adobe-3.0 EPSF-3.0\n";
static char second_line_start[] = "%%Creator: Zint ";
@@ -2053,7 +2053,7 @@ const char *testUtilHaveIdentify(void) {
/* Check raster files */
int testUtilVerifyIdentify(const char *const prog, const char *filename, int debug) {
char cmd[512 + 128];
char cmd[512 + 128] = {0}; /* Suppress clang -fsanitize=memory false positive */
if (strlen(filename) > 512) {
return -1;
@@ -2210,7 +2210,7 @@ int testUtilHaveTiffInfo(void) {
/* Check TIF files */
int testUtilVerifyTiffInfo(const char *filename, int debug) {
char cmd[512 + 128];
char cmd[512 + 128] = {0}; /* Suppress clang -fsanitize=memory false positive */
if (strlen(filename) > 512) {
return -1;