public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* MISRA C
@ 2021-10-13 13:10 Baraa Jarkas
  2021-10-13 19:35 ` Jonathan Wakely
  0 siblings, 1 reply; 3+ messages in thread
From: Baraa Jarkas @ 2021-10-13 13:10 UTC (permalink / raw)
  To: gcc-help

Hi,

I would like to know which Misra C Rules are supported by GCC compiler and if there is any document contains these informations.


Best regards,
Baraa

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MISRA C
  2021-10-13 13:10 MISRA C Baraa Jarkas
@ 2021-10-13 19:35 ` Jonathan Wakely
  2021-10-15 15:50   ` David Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Wakely @ 2021-10-13 19:35 UTC (permalink / raw)
  To: Baraa Jarkas; +Cc: gcc-help

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: MISRA C
  2021-10-13 19:35 ` Jonathan Wakely
@ 2021-10-15 15:50   ` David Brown
  0 siblings, 0 replies; 3+ messages in thread
From: David Brown @ 2021-10-15 15:50 UTC (permalink / raw)
  To: Jonathan Wakely, Baraa Jarkas; +Cc: gcc-help

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-15 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 13:10 MISRA C Baraa Jarkas
2021-10-13 19:35 ` Jonathan Wakely
2021-10-15 15:50   ` David Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).