Electronics > Microcontrollers

MISRA C & OpenSource

<< < (7/8) > >>

newbrain:

--- Quote from: SiliconWizard on October 14, 2021, 07:25:52 pm ---But it's not a complete waste of time, as I too use Cppcheck - just not with MISRA-C rules - and routinely recommend it.

--- End quote ---
Absolutely not - I was also curious and it has quite a bit of relevance with (a part of) my work.
We use this open source checker from Ericsson, based on clang-tidy and clang-analyzer but that can include and store the results from many others tools (cppcheck included) and has some pretty visualization.

SiliconWizard:

--- Quote from: newbrain on October 14, 2021, 07:55:27 pm ---We use this open source checker from Ericsson, based on clang-tidy and clang-analyzer but that can include and store the results from many others tools (cppcheck included) and has some pretty visualization.

--- End quote ---

I'll check it out.

SiliconWizard:
And anyone interested, there is an official example suite for MISRA-C 2012: https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite
That gives examples of compliant and non-compliant code for every rule.

JPortici:
yeeeeah... CppCheck gives a number of bogus warnings regarding misra, also can't recognize interrupt functions (probably because it ignores nonstandard features like __attribute__)  so i get bogus warnings about unused functions.
And i haven't been able to produce a rules file from the standard, i don't understand what you need to do (and all the just use/just do on the support forum don't work with the copy protected PDFs of the standard) so i used the modified cppcheck in MPLABX.

But all in all it helped me from time to time, would recommend as it also gives lots of warnings that GCC doesn't (or i'd rather have to say the GCC version i am bound to use, which is 4.2.8 or something)


--- Quote from: newbrain on October 14, 2021, 07:55:27 pm ---
--- Quote from: SiliconWizard on October 14, 2021, 07:25:52 pm ---But it's not a complete waste of time, as I too use Cppcheck - just not with MISRA-C rules - and routinely recommend it.

--- End quote ---
Absolutely not - I was also curious and it has quite a bit of relevance with (a part of) my work.
We use this open source checker from Ericsson, based on clang-tidy and clang-analyzer but that can include and store the results from many others tools (cppcheck included) and has some pretty visualization.

--- End quote ---

but this looks really cool. i have to check it out

semir-t:
Thank you for your answers.
 
Because this is my first encounter with the cppcheck, the idea behind my code was to try to trigger cppcheck and see what kind of error/warning messages I would get. And all of the stuff that you mentioned that are used in the code are deliberate (access array out of boundaries etc...). But what puzzled me is the error message  (style) Function types shall be in prototype form with named parameters (Required) [misra-c2012-8.2], because for each function I have named parameters (in definition and declaration).

Yes, I assume that commercial applications are way better and we do have one in mind. Problem is that this application is linked to the PC, so only one person can use it. So our idea was to try to get some free version that would help our team develop the code  which will be as closely as possible compliant with the MISRA standard.  Frequently we would use commercial app to solve all the issues.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version