Like the title, how do I use -Wall option on gcc/g++ and turn off the multi line comments warnings?
The comment look like that:
// Comment starts here \
// and end here (the // at the begging is not necessary)
You could use /* .. */ for the multiline comment.
/* foo bar comment
lala blah
*/
Edit:
I found a solution in another post here: How can I hide "defined but not used" warnings in GCC?
If you add the option -Wno-comment the warning is gone.
gcc -Wall -Wno-comment test.c -o test
Its also explained here: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
best wishes, Matthias
The GCC warnings are documented here: http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
Specifically, you're looking for:
-Wcomment
Warn whenever a comment-start sequence
/*' appears in a
/*' comment, or whenever a Backslash-Newline appears in a `//' comment. This warning is enabled by -Wall.
So to turn that warning off, you should be able to use -Wno-comment
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With