MISRA C

David Brown david.brown@hesbynett.no
Fri Oct 15 15:50:09 GMT 2021


On 13/10/2021 21:35, Jonathan Wakely via Gcc-help wrote:
> On Wed, 13 Oct 2021 at 14:11, Baraa Jarkas via Gcc-help
> <gcc-help@gcc.gnu.org> wrote:
>>
>> Hi,
>>
>> I would like to know which Misra C Rules are supported by GCC compiler and if there is any document contains these informations.
> 
> What do you mean by "supported"?
> 
> Valid C code that follows MISRA rules can be compiled by GCC, but I
> doubt that's what you mean.
> 
> If you want something to check that the rules are followed, that's not
> what GCC is for. GCC is a compiler. There are static analysis tools
> that can check for conformance to guidelines like MISRA.
> 


I find gcc very useful for static analysis too - much better than many
commercial compilers that support MISRA rule checking.

But many of the MISRA rules would be more suitable in a plugin, perhaps
using David Malcolm's static analyser framework or his Python plugin.

There's also the issue that MISRA is not free (it's cheap - £10, as far
as I remember - but very far from "GPL free").  I don't know the
licensing or copyright complications that might be involved in making a
plugin that referenced rules in MISRA's guidelines.


More information about the Gcc-help mailing list