https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95024

--- Comment #4 from Alejandro Colomar <alx at kernel dot org> ---
Sorry, I didn't make it clear; I somehow forgot about it.

Here's the problem:

$ cat err.c 
int
main(void)
{
        short s;
        int   *p;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wno-error=incompatible-pointer-types"
        p = &s;
#pragma GCC diagnostic pop
}


$ gcc err.c 
err.c: In function ‘main’:
err.c:8:32: warning: unknown option after ‘#pragma GCC diagnostic’ kind
[-Wpragmas]
    8 | #pragma GCC diagnostic ignored "-Wno-error=incompatible-pointer-types"
      |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
err.c:8:32: note: did you mean ‘-Wno-incompatible-pointer-types’?
err.c:9:11: warning: assignment to ‘int *’ from incompatible pointer type
‘short int *’ [-Wincompatible-pointer-types]
    9 |         p = &s;
      |           ^

Reply via email to