liveBook · Manning

Style guide

As explained in Memory Safe C++

A set of rules specifying what software source code may contain and what it must not do.

A use-after-free can compile cleanly yet cause a reliability failure or an exploitable security vulnerability. A C++ compiler checks conformance to the language standard, but it typically cannot see the runtime values and thread ordering on which many memory safety failures depend. section 2.0 section 2.7

A style guide, or coding guideline, is a catalog of rules specifying what source code may contain and what it must not do. In safety-critical development, it translates the language requirements of a safety standard into concrete rules for a disciplined reviewer or tool to check. It is one part of a wider process that also includes verification, documentation, and independent assessment. section 2.0 section 2.7

C++ guidelines restrict error-prone or nondeterministic constructs and patterns that make verification difficult. Static and dynamic analysis can check rules mechanically and produce evidence for certification; a guideline or tool alone is not the whole safety process. section 2.2 section 1.4.3

Choosing a C++ guideline

MISRA C++:2023 targets reliability and certification evidence, with mandatory, required, and advisory rules. CERT C++ adds a security focus, linking applicable rules to known weaknesses. Existing automotive projects may still reference AUTOSAR C++14, although MISRA C++:2023 is its successor for new projects. section 2.2

Table 2.1 Major C++ coding guidelines for safety-critical systems
Guidelines
C++ Version
Number of Rules
Primary Domain
Status
MISRA C++:2023
17
179
Automotive, Aerospace, Medical, Rail
Current standard
AUTOSAR C++14
14
342
Automotive
Merged into MISRA C++ 2023
CERT C++
11/14
83
Defense, Connected Systems
Active
HIC++
11
155
Aerospace, UK Defense
Active
JSF C++
98/03
200+
Avionics (F-35)
Legacy

Compare major C++ guidelines by language version, rule count, domain, and status. section 2.2

How Memory Safe C++ covers it

How deep it goes
Explains the rationale for restricting constructs and patterns, then compares guideline scope, rule categories, and certification roles.
Examples
Compares MISRA C++:2023, AUTOSAR C++14, CERT C++, HIC++, and JSF C++ by version, domain, rule count, and status.
What you can do after
Evaluate and understand which coding guideline translates a project's governing safety standard into an enforceable C++ subset.
How it connects
Connects coding guidelines to safety standards, static analysis, dynamic analysis, certification, and memory safety.

Also explained in

Compare how 13 books explain style guide →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Memory Safe C++. The section links point to the parts of the book it draws on.