https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7651
Heiko Eißfeldt <heiko at hexco dot de> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |heiko at hexco dot de
--- Comment #36 from Heiko Eißfeldt <heiko at hexco dot de> ---
I am working on this now.
Here is the first patch to update the documentation with newly added options
for -Wextra:
https://gcc.gnu.org/pipermail/gcc-patches/2026-April/713252.html
===
While working on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7651
(Define -Wextra strictly in terms of other warning flags) I started with
checking the documentation for warning options that are enabled by
-Wextra. Whenever the individual option was described as being enabled
with -Wextra I checked whether this option is listed under the
description of -Wextra.
I could add 3 missing named options and remove
one unnamed warning "Ambiguous virtual bases", which now seems to be
-Winaccessible-base.
I found that -Wenum-conversion also warns for
Objective-C (which I added) and -Wno-builtin-declaration-mismatch is
available for C and Objective-C. In the example code for
-Wno-builtin-declaration-mismatch I found that this is only working as
described for C versions up to C18, but not anymore for C23, which
produces an error here instead.
This is intended for the upcoming 16.1 release.
2026-04-18 Heiko Eißfeldt<[email protected]>
PR middle-end/7651
* gcc/doc/invoke.texi (-Wextra):
update list of enabled warning options for -Wextra
add language dependencies for -Wenum-conversion and
-Wno-builtin-declaration-mismatch
add C version to-Wno-builtin-declaration-mismatch
example code description
===
For the first warning without an explicit warning option (A pointer is compared
against integer zero with <, <=, >, or >=.)
```c
int main(void)
{
char *p = 0;
return p > 0;
}
```
yields
<source>:4:14: warning: ordered comparison of pointer with integer zero
[-Wextra]
4 | return p > 0;
| ^
I thought of a name of "-Wpointer-orderedcompare-to-zero".