-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Description
| Bugzilla Link | 9128 |
| Version | trunk |
| OS | Linux |
Extended Description
I'd expect this to give two warnings, but none is given:
_Bool foo(void) {
_Bool x = (void *)0;
return (void *)0;
}Not having this warning already caused a bug in my program, so this makes _Bool type even worse to me than using "int" as the boolean type.
I guess this might be because C99 says:
"When any scalar value is converted to _Bool, the result is 0 if the value compares equal to 0; otherwise, the result is 1."
If -Wall isn't good enough place for this, maybe a new -Wstrict-bool? (Actually I'd prefer such warning to check for other things about booleans too, but that's another thing.)
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer