This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Adoption of C subset standards




On 09/01/17 19:43, Paul.Koning@dell.com wrote:

On Jan 9, 2017, at 1:28 PM, Richard Kenner
<kenner@vlsi1.ultra.nyu.edu> wrote:

Regardless of that sort of issue, I think on previous occasions
when the topic of MISRA (or other coding standard) checking came
up, there has been a general opinion from the gcc developers that
the compiler itself is not the best place for this sort of
checking - they recommend an external tool, and don't want the
main code base cluttered with such specific warnings for the
dozens of coding standards in common use.

Note that there's also a legal issue here: when one has to obtain
a license from MISRA.

I found a reference to this in MISRA's forums:

<https://www.misra.org.uk/forum/viewtopic.php?f=56&t=1189>

The post and reply are from 4 years ago, but I expect the situation is the same now as then. Basically, MISRA are quite happy for any tools to support checking of the rules, no matter what the license of the tools, and there is no certification or checking for conformance. However, if you are going to include the rule texts, you need that part of the checker to be under a "commercial license agreement that contain[s] the expected restrictions on reverse engineering or extracting of information from the software". The say it's fine for a pure open source checker to refer to the checks by MISRA rule number, but not by rule text. It looks like no license is needed from MISRA to do this. (Obviously the people writing the checker will need a copy of the MISRA standards themselves, but at £10 it is not a deal breaker.)


I suspect there are vast quantities of coding guidelines out there,
some of which may make some sense while others may not.  I don't see
a good reason why one particular club should have its suggestions
embodied in GCC code.

I don't want to sound rude, but it would seem you are not aware of the special position MISRA holds. In safety critical embedded development, especially in Europe, following MISRA standards can easy be a non-negotiable requirement for development. And because gcc does not support checking, and any third-party checking tool costs at least as much as a compiler /with/ checking (such as Keil, IAR, GHS), this basically rules out gcc as an option for this sort of development. For those in these industries, it is a real shame - not because gcc is cheap or free while IAR and GHS cost an arm and a leg, but because gcc is a much better compiler.

No other coding standard or guidelines has the same position as MISRA - it is /not/ like using Google Coding Standards or the JSF standards. (Another difference is that those are better standards - MISRA has a number of points that are /very/ questionable.)

However, for most gcc users, MISRA checking is useless or worse than useless (because it encourages a number of bad coding practices), which is why it makes sense for a checker to be a plugin and not an integral part of gcc.


But as for a license, it's hard to see why that might be.  You can't
copyright rules (only a particular expression of same, and only to
the extend that the "sweat of the brow" rule doesn't apply).

You can copyright the text of the rules, and trademark the name MISRA.

 And it
doesn't sound like patentable matter either.  That said, if some
outfit thinks it can ask for licensing on matter of this kind, that
in itself is in my mind sufficient to exclude them from any
consideration.

paul



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]