coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nstrftime.c fails to build due to memset overflow


From: Bruno Haible
Subject: Re: nstrftime.c fails to build due to memset overflow
Date: Tue, 14 Mar 2023 18:09:07 +0100

Pádraig Brady wrote:
>    return cnt == digest_bin_bytes;
>  }
>  
> +# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
>  static bool
>  digest_check (char const *checkfile_name)
>  {

Note that this pragma produces a warning with GCC versions < 4.7:

GCC 4.6.4:
foo.c:1:10: warning: unknown option after ‘#pragma GCC diagnostic’ kind 
[-Wpragmas]

GCC 4.1.2:
foo.c:1: warning: ignoring #pragma GCC diagnostic

and with non-GCC-compatible compilers such as AIX xlc:

"foo.c", line 1.1: 1506-224 (I) Incorrect pragma ignored.

It would therefore be better to protect it like this:

# if defined __GNUC__ && (__GNUC__ + (__GNUC_MINOR__ >= 7) > 4)
#  pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
# endif

Bruno






reply via email to

[Prev in Thread] Current Thread [Next in Thread]