[master] 90fe6063c Build: Use GCC pragma to suppress y2k warning

Nils Goroll nils.goroll at uplex.de
Mon Dec 4 12:30:06 UTC 2023


commit 90fe6063c61b79b6585077c91a598ebdeaa23e98
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Dec 4 13:26:38 2023 +0100

    Build: Use GCC pragma to suppress y2k warning
    
    The problem with 93974b3f9f51c5591345b0fc37e51437393659f3 is that the
    negating option from Makefile.am comes before CFLAGS, which does not
    disable it for gcc.
    
    Tested locally with gcc and clang.

diff --git a/lib/libvarnish/Makefile.am b/lib/libvarnish/Makefile.am
index aa88f486a..946966cf9 100644
--- a/lib/libvarnish/Makefile.am
+++ b/lib/libvarnish/Makefile.am
@@ -82,5 +82,5 @@ vsb_test_CFLAGS = $(AM_CFLAGS) -DVSB_TEST
 vsb_test_LDADD = $(AM_LDFLAGS) libvarnish.la
 
 vtim_test_SOURCES = vtim.c
-vtim_test_CFLAGS = $(AM_CFLAGS) -DTEST_DRIVER -Wno-error=format-y2k
+vtim_test_CFLAGS = $(AM_CFLAGS) -DTEST_DRIVER
 vtim_test_LDADD = $(AM_LDFLAGS) libvarnish.la
diff --git a/lib/libvarnish/vtim.c b/lib/libvarnish/vtim.c
index 31a216ca6..2d3569e86 100644
--- a/lib/libvarnish/vtim.c
+++ b/lib/libvarnish/vtim.c
@@ -456,6 +456,8 @@ VTIM_timespec(vtim_dur t)
 
 #ifdef TEST_DRIVER
 
+#pragma GCC diagnostic ignored "-Wformat-y2k"
+
 #include <stdint.h>
 
 static void


More information about the varnish-commit mailing list