My code will compile fine with -std=c++0x flag but the TA refuses use it (He thinks it will cause issues with other student's code). Is there any way to tell the compiler to use this flag in code instead?
Asked
Active
Viewed 68 times
1
-
Do you supply the makefile? – Yakk - Adam Nevraumont Oct 18 '15 at 00:38
-
No. Currently we don't. – John Oct 18 '15 at 00:42
-
If such a thing could be possible, it would be through [`pragma`s](https://gcc.gnu.org/onlinedocs/gcc/Pragmas.html). But I didn't find any that does that. (the closest a pragma came to "altering" my compiler flags was when [disabling diagnostics](https://stackoverflow.com/a/3394268/865719) ... which is irrelevant to the issue you're raising here...) – maddouri Oct 18 '15 at 00:48
-
@John Run away from this place! – Ivan Aksamentov - Drop Oct 18 '15 at 01:03
1 Answers
2
You can't, sorry.
Generally speaking, you cannot change compiler options from a source file, especially for options with wide-reaching implications like the language standard. There are some exceptions (for instance, you can often selectively disable warnings using a #pragma
), but this isn't one of them.