Re: [PATCH] Add support for nonnull_if_nonzero attribute [PR117023]

2024-11-13 Thread Jakub Jelinek
On Wed, Nov 13, 2024 at 10:13:23AM +0100, Richard Biener wrote: > > /* Return true if OP can be inferred to be a non-NULL after STMT > > - executes by using attributes. */ > > + executes by using attributes. If OP2 is non-NULL and nonnull_if_nonzero > > + is the only attribute implying OP

Re: [PATCH] Add support for nonnull_if_nonzero attribute [PR117023]

2024-11-13 Thread Richard Biener
On Tue, 12 Nov 2024, Jakub Jelinek wrote: > Hi! > > As mentioned in an earlier thread, C2Y voted in a change which made > various library APIs callable with NULL arguments in certain cases, > e.g. > memcpy (NULL, NULL, 0); > is now valid, although > memcpy (NULL, NULL, 1); > remains invalid. Thi

[PATCH] Add support for nonnull_if_nonzero attribute [PR117023]

2024-11-12 Thread Jakub Jelinek
Hi! As mentioned in an earlier thread, C2Y voted in a change which made various library APIs callable with NULL arguments in certain cases, e.g. memcpy (NULL, NULL, 0); is now valid, although memcpy (NULL, NULL, 1); remains invalid. This affects various APIs, including several of GCC builtins; pl