disabling compiler warnings in Creator editor?
-
Hi -
Is there a way to disable (selectively or otherwise) the compiler warnings that show up in Creator? I'm aware that I can eliminate the text of the warning by turning off line annotations, but I'm wondering whether I can eliminate them entirely.
The warning in question is about the use of old-style casting. I can eliminate this at compile time with -Wno-old-style-cast, but I don't know how to apply that to the editor.
Thanks...
-
Hi,
Not in the editor (it's unrelated to it), but you can disable that in your .pro file by setting the appropriate compiler flag.
-
AFAIK, if you eliminate it at compile time, it should not appear in the list either.
-
Hi
Just to be sure You did not mean these ?
-
Hi @mzimmers,
As already said, better is fixing that issues - but sometimes you cannot do it for legacy projects.
Solution in that case is not to disable the Clang plugin, but to configure it:
Tools > Options > C++ > Code Model > Clang Code Model > Manage
There you can create your own config and apply either global or for a single project.
Regards
PS: The config switch you are looking for should be
-Wno-old-style-cast
-
Thanks, aha. In this case, the warnings come header files supplied by a third party and intended for use with C (which I don't believe has the modern casts yet, and in any event, needs to be retroactively compatible with older compilers), so fixing them is out.
Thanks for the lesson on managing the code model...another part of Creator I'd never used, so that was a good thing to get exposed to.
-
You may also tune the clang code model and ignore single warnings to be displayed in the editor.
You may want to check out last of post here
Possibly you can switch off the macros before and on after the include. I would expect that the clang code model will be able to pick it up. As said by many before, it is not a good idea to ignore warnings. As a matter of fact I start to love the warnings shown directly in the code editor. Even though it is a bit confusing the first time ;)