[master] 90fe6063c Build: Use GCC pragma to suppress y2k warning
Dridi Boukelmoune
dridi at varni.sh
Mon Dec 4 12:38:03 UTC 2023
On Mon, Dec 4, 2023 at 12:30 PM Nils Goroll <nils.goroll at uplex.de> wrote:
>
>
> 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
Thanks for taking care of it.
> The problem with 93974b3f9f51c5591345b0fc37e51437393659f3 is that the
> negating option from Makefile.am comes before CFLAGS, which does not
> disable it for gcc.
It did on my machine, it turned the error into a simple warning.
> 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
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit
More information about the varnish-commit
mailing list