News for hackers. Stuff that matters.
Re:Compiler Warnings by berti on Thursday January 24, 2019 @05:12PM (#18993565)
This unfortunately gets messy when you're targeting multiple compilers, and in some cases multiple versions of the same compiler.
Re:Compiler Warnings by loeg on Thursday January 24, 2019 @05:53PM (#18993881)
Works well if your only targets are GCC and Clang. For building across several platforms with other compilers, you could just manipulate the flags globally on those other compilers without giving up high levels and specificity of warnings on gcc/clang.
Re:Compiler Warnings by deogeo on Thursday January 24, 2019 @05:38PM (#18993777)
At least clang has it covered: https://clang.llvm.org/docs/UsersManual.html#pragma-gcc-diag...

Don't know what the situation is on MS's and Intel's compilers.

Re:Compiler Warnings by raptorfactor on Thursday January 24, 2019 @06:52PM (#18994238)
Re:Compiler Warnings by MaulingMonkey on Thursday January 24, 2019 @10:44PM (#18995392)
And you can use _Pragma / __pragma to hide them inside (conditional) macros without #ifdefing up every call site.

There are still edge cases where you can't sanely scope them relating to when templates are evaluated, being unable to use the pragmas at arbitrary points of an expression, warnings that don't respect the warning flags properly, etc. - but it works most of the time.

That said, for warnings with high false positives and low value true positives, I'll just globally suppress the warning.