bug-gnulib
[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: Thu, 18 May 2023 23:38:19 +0200

To silence these warnings:

 * -O0 only:
 ../../gllib/nstrftime.c:148:31: warning: 'memset' specified size 
18446744073709551615 exceeds maximum object size 9223372036854775807 
[-Wstringop-overflow=]
 ../../gllib/nstrftime.c:147:32: warning: 'memset' specified size 
18446744073709551615 exceeds maximum object size 9223372036854775807 
[-Wstringop-overflow=]
 
 * -O1, -O2, -O3 only:
 ../../gllib/vasnprintf.c:945:26: warning: argument 1 value 
'18446744073709551615' exceeds maximum object size 9223372036854775807 
[-Walloc-size-larger-than=]
 
 * -O2, -O3, -Os only:
 ../../gllib/astrxfrm.c:177:1: warning: function may return address of local 
variable [-Wreturn-local-addr]

I am applying these patches. The warning in vasnprintf.c is a consequence of
the use of SIZE_MAX (by xsize.h) to make malloc() fail. The warnings in
nstrftime.c and astrxfrm.c are false positives, due to insufficient data
flow analysis by gcc.


2023-05-18  Bruno Haible  <bruno@clisp.org>

        vasnprintf, c-vasnprintf: Silence gcc warning.
        * lib/vasnprintf.c: Add #pragma GCC diagnostic.

2023-05-18  Bruno Haible  <bruno@clisp.org>

        nstrftime: Silence gcc warning.
        * lib/nstrftime.c: Add #pragma GCC diagnostic.

2023-05-18  Bruno Haible  <bruno@clisp.org>

        astrxfrm: Silence gcc warning.
        * lib/astrxfrm.c: Add #pragma GCC diagnostic.

Attachment: 0001-astrxfrm-Silence-gcc-warning.patch
Description: Text Data

Attachment: 0002-nstrftime-Silence-gcc-warning.patch
Description: Text Data

Attachment: 0003-vasnprintf-c-vasnprintf-Silence-gcc-warning.patch
Description: Text Data


reply via email to

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