From 008dff4aec8fff816286fac953932e5d8b7288d9 Mon Sep 17 00:00:00 2001 From: gitlost Date: Fri, 12 Sep 2025 22:49:28 +0100 Subject: [PATCH] Suppress gcc-15 warning -Wunterminated-string-initialization ci: macOS: try GS1 Syntax Engine agin --- .github/workflows/ci.yml | 5 ++++- backend/mailmark.c | 2 +- backend/tests/test_aztec.c | 2 +- backend/upcean.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee9fd44d..7405513f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -161,10 +161,13 @@ jobs: shell: bash run: git config --global --add safe.directory ${GITHUB_WORKSPACE} && cmake -E make_directory build + - name: Install GS1 Syntax Engine + run: git clone https://github.com/gs1/gs1-syntax-engine && cd gs1-syntax-engine/src/c-lib && make CFLAGS_G='-DEXCLUDE_SYNTAX_DICTIONARY_LOADER' lib && (sudo make install || true) + - name: Configure CMake working-directory: build shell: bash - run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DZINT_TEST=ON -DZINT_STATIC=ON -DZINT_USE_PNG=OFF -DZINT_USE_QT=OFF + run: cmake $GITHUB_WORKSPACE -DCMAKE_C_FLAGS='-I /usr/local/include' -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DZINT_TEST=ON -DZINT_STATIC=ON -DZINT_USE_PNG=OFF -DZINT_USE_QT=OFF - name: Build working-directory: build diff --git a/backend/mailmark.c b/backend/mailmark.c index 3ecac74d..fc9b2370 100644 --- a/backend/mailmark.c +++ b/backend/mailmark.c @@ -513,7 +513,7 @@ INTERNAL int zint_datamatrix(struct zint_symbol *symbol, struct zint_seg segs[], /* Royal Mail 2D Mailmark (CMDM) (Data Matrix) */ /* https://www.royalmailtechnical.com/rmt_docs/User_Guides_2021/Mailmark_Barcode_definition_document_20210215.pdf */ INTERNAL int zint_mailmark_2d(struct zint_symbol *symbol, unsigned char source[], int length) { - static const char spaces[9] = " "; + static const char spaces[9] = { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }; unsigned char local_source[90 + 1]; char postcode[10]; int i; diff --git a/backend/tests/test_aztec.c b/backend/tests/test_aztec.c index aa4c6661..2dcddfab 100644 --- a/backend/tests/test_aztec.c +++ b/backend/tests/test_aztec.c @@ -2471,7 +2471,7 @@ static void test_encode(const testCtx *const p_ctx) { "0011010000001001010" "1011000010000000000" }, - /* 48*/ { BARCODE_AZTEC, GS1_MODE, -1, -1, -1, 6, { 2, 4, "12345678901234567890123456789012" }, "[01]12345678901231[10]01", -1, ZINT_WARN_NONCOMPLIANT, 23, 23, 1, 1, "GS1 with Structured Append, full symbol", + /* 48*/ { BARCODE_AZTEC, GS1_MODE, -1, -1, -1, 6, { 2, 4, { '1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2','3','4','5','6','7','8','9','0','1','2' } }, "[01]12345678901231[10]01", -1, ZINT_WARN_NONCOMPLIANT, 23, 23, 1, 1, "GS1 with Structured Append, full symbol", "11100110011000010001000" "10100110000110101111010" "11000101100000111000011" diff --git a/backend/upcean.c b/backend/upcean.c index 71baa0fb..98130b65 100644 --- a/backend/upcean.c +++ b/backend/upcean.c @@ -614,7 +614,7 @@ static int isbnx(struct zint_symbol *symbol, unsigned char source[], const int l /* Check if GTIN-13 `source` is UPC-E compatible and convert as UPC-E into `out` if so */ static int ean_is_upce(const unsigned char source[], unsigned char *out) { - static const char zeroes[5] = "00000"; + static const char zeroes[5] = { '0', '0', '0', '0', '0' }; if (source[0] != '0' || source[1] > '1') { return 0;