How to ignore 'comparison between signed and u

2020-05-17 08:25发布

问题:

Can anybody please tell me which flag I have to use in order to make gcc ignore the 'comparison between signed and unsigned integer expressions' warning message.

回答1:

gcc -Wno-sign-compare

But you should really fix the comparison it's warning you about anyway.



回答2:

Here's what worked for me, using the gcc compiler in Code::Blocks. In the compiler settings, click the "Compiler Settings" tab, then choose "Other Compiler Options. Type in -Wno-sign-compare The warning -Wsign-compare can be negated by adding "-Wno" as a prefix. In fact warnings can be ignored by adding -Wno- to the warning code.



标签: c++ gcc