[C-safe-secure-studygroup] Les Hatton's writings on safer subsets of C

McCall, Gavin (G.F.) gavin.mccall at visteon.com
Wed Mar 8 09:54:03 UTC 2017


Les's book "Safer-C" was reference [2] in the 1998 - first version of MISRA-C. It is reference [3] in the third and current version.

Les is keen that we have data-driven rules, rather than "seems like a good idea" rules. 

Do we have data that confirms that a certain practice IS error prone, or do we just want to ban it.

An example is the use of goto.

IEC 61508 banned goto, probably on the basis that you can write spaghetti code. 

MISRA-C 2012 allows limited use of goto - the ban went from required to advisory.

This is therefore more about a limit on the structural complexity of the function, rather than the use of an explicit statement type.

Les also spoke and presented at the recent Safety Critical Systems Symposium 2017 in Bristol.

A key feature of his talk, based on analysis of millions of lines of code is that most code fits two types
	Trivial - cyclomatic complexity < 2, few lines of code, or
	Complex - complex functions are complex, and all real software retains a small number of very complex functions.

Gavin



> -----Original Message-----
> From: C-safe-secure-studygroup [mailto:c-safe-secure-studygroup-
> bounces at lists.trustable.io] On Behalf Of Wheeler, David A
> Sent: 07 March 2017 22:13
> To: C Safety and Security Study Group Discussion <c-safe-secure-
> studygroup at lists.trustable.io>
> Subject: [C-safe-secure-studygroup] Les Hatton's writings on safer subsets of
> C
> 
> FYI -
> 
> Les Hatton (author of "Safer C") has written a number of articles about
> subsetting C, MISRA, etc.  I know many of you are aware of his work, but
> perhaps some of you are not.  It's certainly interesting & relevant to this
> group.  His articles are here:
> 
>   http://www.leshatton.org/index_SA.html
> 
> He emphasizes that this needs to be guided by real-world code, & that there
> should be an emphasis on limiting false positives.
> 
> --- David A. Wheeler
> 
> _______________________________________________
> C-safe-secure-studygroup mailing list
> C-safe-secure-studygroup at lists.trustable.io
> https://lists.trustable.io/cgi-bin/mailman/listinfo/c-safe-secure-studygroup


More information about the C-safe-secure-studygroup mailing list