Am Montag, dem 02.06.2025 um 18:45 +0000 schrieb Joseph Myers:
> On Mon, 2 Jun 2025, Martin Uecker wrote:
> 
> > According to the discussion in the bugzilla there seems to be
> > some consensus to activate the warning for -Wextra (I am also
> > looking into implementing the suggested improvements that may
> > make it suitable fo r-Wall).   When making this change, I also
> > noticed that it was not working for -Wc++-compat due to a typo.
> 
> What are the cases of interest where this detects buggy code that isn't 
> detected by -Wmaybe-uninitialized (also included in -Wextra)?  Is this 
> about -O0 compilations?

One example would be:

void t(int *);
void m(void)
{
        goto foo;
        int i = 0;
foo:
        t(&i);
}

> 
> If it's not working for -Wc++-compat I'd expect a testcase added (fails 
> before the patch, passes after) that tests the warning with -Wc++-compat.
> 
I added the test for -Wextra.   I will change it to -Wc++-compat and submit
it with the bugfix as a separate patch.

Martin



Reply via email to