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: Marc Nieper-Wißkirchen
Subject: Re: undefined-behavior obstack.c:139
Date: Fri, 1 Dec 2023 17:14:20 +0100

By 6.5.6 "Additive Operators":

(2) "... one operator shall be a pointer to a complete object type..."

NULL, which is a null pointer constant, is not necessarily a pointer to a complete object type.

(9) "... If the pointer operand and the result do not point to elements of the same array object or one past the last element of the array object, the behavior is undefined..."

NULL does not have to point to an element of an array object (or any object; see (8)).


Am Fr., 1. Dez. 2023 um 17:02 Uhr schrieb Bruno Haible <bruno@clisp.org>:
Jeffrey Walton wrote:
> I think that's a valid finding. NULL is not a valid address. You can't
> add anything to it.

Can you back this opinion with citations from ISO C 23 [1] ?

Bruno

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3054.pdf





reply via email to

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