bool versus _Bool

PC-lint Plus User Discussion
Post Reply
AlainI

bool versus _Bool

Post by AlainI »

C99 added a builtin _Bool data type and if you #include <stdbool.h>, it provides "bool" as a macro to _Bool.
But if you sue "bool" in you code, PC-Lint 1.2 will complain that you use _Bool out of typedef, which is true since this is a macro.
I am a bit puzzled, should I avoid using "bool" and use "_Bool" instead ?
AlainI

Re: bool versus _Bool

Post by AlainI »

Using the following flag seems to solve the issue:

Code: Select all

-strong(B, bool)
Is this the right way to do it ?
Post Reply