3 ms·
Compiling with gcc's -Wall option, which implies -Wcomment, would spit out "warning: multi-line comment". Unless you have good reason to do otherwise, always us
by splicer 15y ago
Compiling with gcc's -Wall option, which implies -Wcomment, would spit out "warning: multi-line comment". Unless you have good reason to do otherwise, always use -Wall. I recommend -Wextra and -Werror as well.
- Jach 15y agoAlso -ansi and -pedantic if you're aiming at the C89 standard for some reason, it's great to look in the gcc manpage and see all the little flags that are around. I don't often like -Werror since it can interrupt my flow. If I'm testing runtime correctness, and something like "suggest parentheses around assignment used as truth value" pops up when that was intentional, I don't want to make the context switch to go back and fix it and recompile before context switching again back to test whatever runtime correctness I was aiming for. I'll fix it later. Philosophically, -Werror assumes I'm the type of person who ignores warnings completely for the duration of a project, and will stop you from ignoring them in the first place even if there may be reasons to; I don't think most people are that way.
- kmm 15y agoI wish they were standard GCC behaviour. Sometimes when I rapidly make a toy program, I forget something important, like including stdio.h and without warnings, I won't know until the program crashed.