bug-m4
[Top][All Lists]
Advanced

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

Re: undefined-behavior obstack.c:139


From: Paul Eggert
Subject: Re: undefined-behavior obstack.c:139
Date: Fri, 1 Dec 2023 12:01:11 -0800
User-agent: Mozilla Thunderbird

On 2023-12-01 10:40, Bruno Haible wrote:

Indeed, this sentence appears to forbid ((char *) NULL) + something.

Yes. However, Gnulib code can still use ((char *) NULL) + something) because the Gnulib portability guidelines allow it.

The issue with clang false positives is covered here:

https://www.gnu.org/software/gnulib/manual/html_node/Unsupported-Platforms.html

which lists "clang -fsanitize=undefined" as an unsupported platform unless you also specify "-fno-sanitize=pointer-overflow".

The obstack patch you installed is fine, as it's clearer and just as fast as the original. However, we needn't go through Gnulib and change other code merely because it runs afoul of this false alarm from clang.



reply via email to

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