Is it possible to turn off support for “and” / “or” boolean operator usage in gcc?

后端 未结 4 2047
忘了有多久
忘了有多久 2020-12-11 06:15

GCC seems to allow \"and\" / \"or\" to be used instead of \"&&\" / \"||\" in C++ code; however, as I expected, many compilers (notably MSVC 7) do not support this. T

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-11 07:05

    Have you considered any code analysis tools? Something similar to FxCop? With FxCop you can write your own rules( check for && ) and you can set it to run during the pre-compile stage.

提交回复
热议问题