[Bug c/117610] -Wzero-as-null-pointer-constant false positive with {0}

2024-11-15 Thread alx at kernel dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117610 --- Comment #3 from Alejandro Colomar --- (In reply to Xi Ruoyao from comment #2) > No, it *is* initializing a pointer. You cannot initialize a struct with 0. > Instead the initializer is considered "flattened" in C. > > For example: > > str

[Bug c/117610] -Wzero-as-null-pointer-constant false positive with {0}

2024-11-15 Thread xry111 at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117610 Xi Ruoyao changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC|

[Bug c/117610] -Wzero-as-null-pointer-constant false positive with {0}

2024-11-15 Thread alx at kernel dot org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117610 --- Comment #1 from Alejandro Colomar --- On the other hand, it would be interesting to have a diagnostic that helps switching from {0} to {}.