[Request] Per File Warning Suppression


#1

Hey JUCE team,

Perhaps this is an issue I alone face, but one struggle I have when using Projucer is the fact that it clears my per file compiler flags.

The main issue for myself is I add a -w flag to files which are 3rd party libraries generating warnings. This is quite nice because I don’t want to dig around too much in those files and I like to make certain my own source files have no warnings.

Is it possible that we could have a suppress warnings checkbox or a per file compile flag options added in Projucer? Has anyone else faced challenges like this?

Currently, whenever I rebuild the project with Projucer I need to go to each source file and re-add the compiler flags.

Thanks!

J


#2

+1 for this


#3

See Projucer individual file compiler settings feature request.


#4

Ohh shoot i missed that apologies! thanks Martin!


#5

In the meantime maybe a pragma warning ignore in the inserted code (or in a wrapper cpp) is an option:
https://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas

#pragma GCC diagnostic ignored "-Wall"

#6

You’re the shit Daniel thank you!

Had no idea about this, hoping it works : )

Best,

J


#7

The #pragma wouldn’t work for me in XCode 9.2, only adding -w to the compiler flags, so I thought I’ll go and add it myself to the Projucer.
For some reason most of the code already exists to inhibit warnings on a per file basis, but the checkbox isn’t available!


That branch is up to date with master of the base JUCE repo, but I added the checkbox. :smile:
Only tested on macOS, but it works perfectly.


#8

Well, it can only work on macOS (looking at the current JUCE master), because the only place where Project::Item::shouldInhibitWarnings() is used is in the Xcode exporter:


#9

Ah, OK I saw that in there and didn’t look any further!