* HELP!!How to add a testing case to check a compilation time warning for "cc1"
@ 2022-08-03 18:52 Qing Zhao
2022-08-03 19:07 ` Qing Zhao
0 siblings, 1 reply; 2+ messages in thread
From: Qing Zhao @ 2022-08-03 18:52 UTC (permalink / raw)
To: gcc-patches
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: HELP!!How to add a testing case to check a compilation time warning for "cc1"
2022-08-03 18:52 HELP!!How to add a testing case to check a compilation time warning for "cc1" Qing Zhao
@ 2022-08-03 19:07 ` Qing Zhao
0 siblings, 0 replies; 2+ messages in thread
From: Qing Zhao @ 2022-08-03 19:07 UTC (permalink / raw)
To: gcc-patches
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 <gcc-patches@gcc.gnu.org> 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-03 19:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-03 18:52 HELP!!How to add a testing case to check a compilation time warning for "cc1" Qing Zhao
2022-08-03 19:07 ` Qing Zhao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).