<div dir="ltr"><div>All,</div><div><br></div><div>If I have source file like this:</div><div><br></div><div>/**********************************/</div><div><div>#include <stdbool.h></div><div>#include <stdio.h></div><div>int main(int argc, char* argv[])</div><div>{</div><div> switch(argc == 2)</div><div> {</div><div> case true:</div><div> puts("argc == 2");</div><div> break;</div><div> case false:</div><div> puts("argc != 2");</div><div> break;</div><div> }</div><div> return 0;</div><div>}</div></div><div>/**********************************/<br></div><div><div><br></div><div>When I compile this source file with -Wall -Werror flags I get an error:</div><div>"main.c:5:3: error: switch condition has boolean value [-Werror]"</div><div><br></div><div>And that's fine. I guess it even makes sense. After all, why on earth wouldn't I just use an if-else statement? I appreciate all responses to this email, but if you do respond PLEASE pretend I don't have much of a choice. My question is, how do turn this specific warning off? I've looked online and saw some post mentioning that this warning is named "switch-bool" but clang doesn't seem to know that. It suggests "switch-enum" but that doesn't help...</div><div><br></div><div><br></div><div>- Max</div>
</div></div>