Open AlexandreSato opened 6 months ago
I don't really want to merge this without cppcheck enforcing this. @0x41head do you think there's a way to make cppcheck check this somehow? I'd put up a new bounty for adding upstream support for that. Maybe we can directly check the token string?
Can I get some context ? What is this commit for ? Why is this commit a problem since false in stdbool is just #define false 0
We want bool tx = 0/1
to fail and bool tx = false/true
to pass for readability, even if 0/1 are the underlying values.
I am not sure if we can push this upstream. But we can definitely make our own addon for this check. Should be easy as all addons work on a dump file generated by cppchecker, which is just an XML.
I'd prefer to upstream it, but that may be an option if the addon is small (<20 lines?)
addon would be pretty small. Probably something like the findcasts addon
That would be totally fine, but let's try to upstream it first.
Cool, let's do a $150 bounty for getting all of these fixed and checked with cppcheck, ideally inside cppcheck, but ok as an addon if they reject it
0 -> false