public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Qing Zhao <qing.zhao@oracle.com>
To: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: HELP!!How to add a testing case to check a compilation time warning for "cc1"
Date: Wed, 3 Aug 2022 19:07:13 +0000	[thread overview]
Message-ID: <88271DAB-6E47-495A-96B4-FE779C71D192@oracle.com> (raw)
In-Reply-To: <EA1A39B3-1E13-402D-9F5E-48AF161D1BEF@oracle.com>

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


      reply	other threads:[~2022-08-03 19:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 18:52 Qing Zhao
2022-08-03 19:07 ` Qing Zhao [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=88271DAB-6E47-495A-96B4-FE779C71D192@oracle.com \
    --to=qing.zhao@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).