3 ms·
I don't get any warnings with -Wall and I get a "unused variables argc and argc" with -Wextra. Changing main's signature to int main() eliminates all warnings
by wulczer 15y ago
I don't get any warnings with -Wall and I get a "unused variables argc and argc" with -Wextra.
Changing main's signature to int main() eliminates all warnings at -Wextra.
- palish 15y agoBrilliant, thanks! I've used up enough of your time already, but if you feel like it...: Do you know if gcc has the equivalent of #pragma warning( disable: N ) ? i.e. could you disable your argc and argv warning for just that source file, and no other? If yes, then is there a way to "scope" that disable to be within a header file? (#pragma warning(push) and #pragma warning(pop))
- wulczer 15y agoYep, you can disable individual warnings with pragmas (http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html) so if I add #pragma GCC diagnostic ignored "-Wunused-parameter" to the C file, I get warningless compilation even with -Wextra. you can also do push/pop to store/restore the warnings reporting options.
- palish 15y agoThank you again!