Re: [PATCH v2] c: add Wzero-as-null-pointer-constant [PR117059]

2024-11-11 Thread Joseph Myers
Other cases to test: the != operator (should warn in same cases as ==); boolean uses of pointers such as if (p), !p, p?x:y, and implicit or explicit conversion to bool (none of those boolean uses of pointers should warn since there's no explicit integer null pointer constant involved in the imp

Re: [PATCH v2] c: add Wzero-as-null-pointer-constant [PR117059]

2024-11-09 Thread Alejandro Colomar
Hi Martin, On Sat, Nov 09, 2024 at 06:15:35PM GMT, Martin Uecker wrote: > > This patch enables the Wzero-as-null-pointer-constant for C. > The second version added more tests and fixes one condition > to not incorrectly warn for nullptr. > > > Bootstrapped and regression tested on x86_64. > >

[PATCH v2] c: add Wzero-as-null-pointer-constant [PR117059]

2024-11-09 Thread Martin Uecker
This patch enables the Wzero-as-null-pointer-constant for C. The second version added more tests and fixes one condition to not incorrectly warn for nullptr. Bootstrapped and regression tested on x86_64. c: add Wzero-as-null-pointer-constant [PR117059] Add warnings for the use o