Never mind, just found how to do this:
/* { dg-warning "'-fstrict-flex-arrays' is not supported with a ISO C before
C99, ignored" "" { target *-*-* } 0 } */
And worked.
thanks.
Qing
> On Aug 3, 2022, at 2:52 PM, Qing Zhao via Gcc-patches
> <[email protected]> wrote:
>
> Hi,
>
> My private cc1 issued the following warning:
>
> [opc@qinzhao-ol8u3-x86 gcc]$ sh t
> cc1: warning: ‘-fstrict-flex-arrays’ is not supported with a ISO C before
> C99, ignored
>
>
> I’d like to add a testing case for this warning into gcc.dg directory,
> however, I cannot find a proper
> testing directive to catch this warning (which is not associated with any
> source line, so “dg-warning” didn’t work)
>
> I checked online internal doc:
> https://gcc.gnu.org/onlinedocs/gcc-12.1.0/gccint/Test-Directives.html
> Cannot find one.
>
> Does anyone know how to do this?
>
> Thanks a lot for your help.
>
> Qing