I have some code that requires a certain gcc compiler option (otherwise it won't compile). Of course, I can make sure in the makefile that for this particular source file the required option is set. However, it would much more helpful, if this option could be set for the respective compilation unit (or part of it) from within the source_file.cpp
.
I know that warning messages can be switched on or off using #pragma GCC diagnostic
, but what about the -fsomething
type of options? I take it from this question that this is impossible.
But perhaps there is at least a way to check from within the code whether a certain -f
option is on or not?
Note I'm not interested in finding the compiler flags from the binary, as was asked previously, nor from the command line.