Adding a flag for a new warning?

Hi,

So I’ve implemented a new warning in clang, but now the test Misc/warning-flags.c is failing: I need to introduce a flag corresponding to this warning.

This is about how my warning looks like in DiagnosticSemaKinds.td:

def warn_my_first_warning: Warning<

“something is wrong here”>,

InGroup;

And I’ve created a corresponding group in DiagnosticGroups.td:

def MyFirstWarning: DiagGroup<“my-first-warning”>;

def MyWarnings : DiagGroup<“my”, [MyFirstWarning]>;

But this does not seem to have fixed the issue, I still see my warning in the output of diagtool in the “Warnings without flags” list.

I couldn’t find any relating information in the clang documentation. Any help would be appreciated.

Hi Gabor,

You method looks correct for adding a new warning with a warning flag. It doesn’t look like it would affect the warning flags test. Could you attach a diff so I can take a closer look?

Richard

Hi Richard,

It turns out it’d be useful to rebuild the “diagtool” binary so that it can pick up the changes… :slight_smile:

Sorry about the noise and thank you for your help!