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

2024-11-09 Thread Alejandro Colomar
Hi Martin, > +void foo(void*); > +void bar() > +{ > + foo(0); /* { dg-warning "zero as null pointer > constant" } */ > + foo(NULL); > + > + void *p = 0;/* { dg-warning "zero as null pointer > constant" } */ > + void *r = NULL; > +

[PATCH] 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. Bootstrapped and regression tested on x86_64. c: add Wzero-as-null-pointer-constant [PR117059] Add warnings for the use of zero as a null pointer constant to the C FE. PR c/117059 gcc/c-family/