seansy
seansy

Reputation: 105

GCC command to exclude a flag from -Wall?

Is it possible when compiling in GCC to include the -Wall flag but then exclude a single flag from that subset, such as -Wattributes? Alternately one could include all the warning flags but -Wattributes but I figured there must be a much cleaner way.

Upvotes: 3

Views: 774

Answers (1)

Some programmer dude
Some programmer dude

Reputation: 409384

Yes it's possible, just prefix the warning name with no-, like in

-Wno-attributes

This is generic for just about all boolean flags, not only warnings.

Upvotes: 6

Related Questions