panda icon indicating copy to clipboard operation
panda copied to clipboard

MISRA safety_toyota.h

Open AlexandreSato opened this issue 1 year ago • 8 comments

0 -> false

AlexandreSato avatar Feb 17 '24 21:02 AlexandreSato

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?

adeebshihadeh avatar Feb 18 '24 19:02 adeebshihadeh

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

0x41head avatar Feb 18 '24 21:02 0x41head

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.

adeebshihadeh avatar Feb 18 '24 21:02 adeebshihadeh

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.

0x41head avatar Feb 19 '24 06:02 0x41head

I'd prefer to upstream it, but that may be an option if the addon is small (<20 lines?)

adeebshihadeh avatar Feb 19 '24 06:02 adeebshihadeh

addon would be pretty small. Probably something like the findcasts addon

0x41head avatar Feb 19 '24 09:02 0x41head

That would be totally fine, but let's try to upstream it first.

adeebshihadeh avatar Feb 19 '24 18:02 adeebshihadeh

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

adeebshihadeh avatar Feb 24 '24 21:02 adeebshihadeh