[cfe-dev] How to add a -W flag?

Thompson, John John_Thompson at playstation.sony.com
Fri Jan 31 12:44:14 PST 2014


Thank you both, Zach and Chad!

-John

From: Zach Davis [mailto:zdavkeos at gmail.com]
Sent: Friday, January 31, 2014 11:55 AM
To: Thompson, John
Cc: cfe-dev at cs.uiuc.edu
Subject: Re: [cfe-dev] How to add a -W flag?

I believe you need to add your warning to a group like so:

  def warn_need_module_import : Warning<
    "Use of identifier '%0' requires import/inclusion of the module '%1'">;

becomes -->

  def warn_need_module_import : Warning<
    "Use of identifier '%0' requires import/inclusion of the module '%1'">,
    InGroup<SomeGroup>;

where "SomeGroup" is taken from DiagnosticGroups.td .

You can add you own group as well, the format is like:

  def SomeGroup : DiagGroup<"some-group">;

and then you should be able to use -Wsome-group


On Fri, Jan 31, 2014 at 1:29 PM, Thompson, John <John_Thompson at playstation.sony.com<mailto:John_Thompson at playstation.sony.com>> wrote:
I'm adding a warning to the end of the "Modules Issues" category in DiagnosticSemaKinds.td:

def warn_need_module_import : Warning<
  "Use of identifier '%0' requires import/inclusion of the module '%1'">;

This makes test/Misc/warning-flags.c fail.

A comment in that test file says:

    If you add a new warning without a flag, this test will fail.  To fix
    this test, simply add a warning group to that warning.

I don't know what that means.  How do I add a warning group to the warning?

Thanks.

-John



_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140131/1797cf79/attachment.html>


More information about the cfe-dev mailing list