Software Coding Guidelines
Learn how ISO 26262-6 turns language risk into project controls: choosing a C or C++ subset, the topics and unit design principles the standard expects, structural coverage, static analysis and deviation records.
Free account: a preview of this guide, plus the full Functional Safety Concept guide, 3 templates and 5 exams a month.
- Chapters
- 16
- Chapters
- Reading paths by role
- 4
- Reading paths by role
Quick answers
- What are coding guidelines in ISO 26262?
- ISO 26262-6 expects safety-related software to follow modelling and coding guidelines that address a defined set of topics, such as low complexity, language subsets, strong typing and defensive implementation. The standard names topics, not a rule set. Projects usually meet them with an established subset, MISRA C for C and MISRA C++ for C++, with CERT as a security-oriented companion; AUTOSAR C++14 still appears in older projects, although its own document now marks it obsolete. A sound setup combines the selected subset, tool-based enforcement, a deviation process for justified violations, and evidence for the safety assessment.
- Does ISO 26262 require MISRA C?
- No. ISO 26262 never names MISRA. It expects coding guidelines that cover its topics, such as language subsets and low complexity, and leaves the choice of rule set to the project. MISRA C, with its guidelines classified as mandatory, required or advisory, is simply the common way to satisfy those topics for C. Claiming compliance with a recognized subset is far easier to defend at assessment than a homegrown guideline document, which is why most automotive projects use MISRA or a MISRA-derived set.
Included in Expert
Read the full guide with Expert
This page is the outline. The complete Software Coding Guidelines guide, 16 chapters, is part of the Expert plan. A free account lets you preview it and includes the complete Functional Safety Concept guide, 3 templates and 5 practice exams a month.
See what Expert includes
Benefits for your project
ISO 26262, Part 6, Clause 5
Choose a defensible baseline
Pick a current MISRA or other subset that matches your language edition and verification tools, reconcile companion guidance such as CERT, and record every local addition.
Read analyser output correctly
Understand what complexity metrics and flow analysis actually measure, pin compiler and analyser configurations with a recorded reason for each option, and keep the findings reviewable.
Manage deviations compliantly
Not every violation can be fixed. Run a formal deviation process with safety impact assessment, alternative measures, and records that survive an ISO 26262 assessment.
Learning outcomes
Select a language subset
Choose a MISRA or other baseline that matches your language edition and tools, and document why.
Cover what Part 6 expects
Address the guideline topics and unit design principles in project guidance, not only in tool settings.
Interpret coverage and metrics
Read structural coverage and analyser output for what they show and what they do not.
Handle dead and deactivated code
Classify each finding and decide whether to remove, test or justify it.
Produce compliance evidence
Run a workflow from commit to release with deviation records an assessor accepts.
Chapters in this guide
- 01
Find your starting point
Choose a reading path for your role, from new safety engineer to developer, architect or assessor.
- Reading paths
- Role-based entry
- Time budgets
- 02
Why coding standards exist
See what a language subset and coding rules can and cannot achieve, and how the guidance evolved.
- Language risk
- Reviewable units
- Assessable evidence
- 03
The ISO 26262 map
Get an overview of the Part 6 topics on languages, unit design and structural coverage, and how to read the recommendation symbols.
- Part 6 overview
- Recommendation strength
- Navigation aid
- 04
The C / C++ subsets
Compare MISRA, AUTOSAR C++14, CERT and HIS by purpose and standing, and pick a current baseline that matches your language edition.
- MISRA C and C++
- CERT as a companion
- Choosing a baseline
- 05
Topics project guidance must address
Go topic by topic through what project guidance has to cover where the language itself falls short.
- Language criteria
- Concurrency aspects
- Integer conversions
- 06
Unit design principles
Work through the design principles for safety-related software units with original examples and project policy suggestions.
- Control flow structure
- Memory and initialization
- Recursion and pointers
- 07
Understanding structural coverage
See what statement, branch and MC/DC coverage each demonstrate and what they never demonstrate.
- Statement and branch
- MC/DC
- Coverage gaps
- 08
Dead, unreachable and deactivated code
Tell the three apart, find each one with the right technique, and decide what to do with every finding.
- Three definitions
- Finding techniques
- EPS assist example
- 09
Writing verifiable code
Apply coding patterns that make units easier to test and review without gaming the metrics.
- Coverage-friendly patterns
- Defensive behavior
- Trust boundaries
- 10
Where code meets the V-model
Connect source code to requirements, architecture and tests so traceability holds from the coding seat.
- Requirements traceability
- Architecture interfaces
- Test links
- 11
What the analyser measures
Read cyclomatic complexity, the HIS metrics and control-flow and data-flow findings for what they are.
- Cyclomatic complexity
- HIS metrics
- Flow analysis
- 12
Floats and fixed-point
Handle the floating-point hazards that matter in control code and decide when fixed-point arithmetic is the better choice.
- Floating-point hazards
- Fixed-point trade-offs
- Defensive wrappers
- 13
AUTOSAR Classic integration
Apply the coding baseline layer by layer in an AUTOSAR Classic stack, including generated code and supplied components.
- Scope by layer
- Generated code
- Watchdog timing allocation
- 14
Toolchain and project files
Set up compilers, analysers and formatters with pinned, justified configurations and the right tool confidence questions.
- Tool roles
- Compiler diagnostics
- Pinned configuration
- 15
From commit to safety case
Follow one route from planning to release evidence and write deviation records that hold up.
- Compliance workflow
- Deviation records
- Release evidence
- 16
Traps to avoid
Recognize the cross-cutting process and implementation traps that undermine a coding guideline program.
- Process traps
- Implementation traps
- Fictional scenarios
Read all 16 chapters with Expert.
Start with a free account: a preview of this guide, the complete Functional Safety Concept guide and 5 practice exams a month, then upgrade when you need this guide.
Expert plan pricingFigures and diagrams in this guide
Interactive figures
ASIL recommendation matrix
How recommendation strength changes across ASILs for the coding-related topics.
Integer conversion at bit level
Watch truncation and sign reinterpretation happen bit by bit.
Lost update and deadlock
Two cores on one time axis, showing how shared data goes wrong.
MC/DC hypercube
A visual way to see which condition pairs demonstrate independent influence.
Baseline ratchet model
How a legacy violation baseline shrinks, or does not, over time.
Who this guide is for
- Embedded C and C++ developers meeting MISRA compliance for the first time
- Software leads defining coding standards and CI quality gates for an ASIL project
- Tool owners configuring and tuning static analysis for guideline enforcement
- Teams assembling coding-compliance evidence for a safety assessment
Questions about Software Coding Guidelines
Start the Software Coding Guidelines guide
The full guide is part of the Expert plan. A free account opens a preview of it, the complete Functional Safety Concept guide, 3 work product templates, 1 guided process, the Markov and RBD simulators and 5 practice exams a month. No credit card required.
Continue with
More related ISO 26262 guides
- SoftwareLinux and Open-Source SafetyBuilding an ISO 26262 safety case for software nobody developed for you: pin down the exact kernel as an element, choose between qualification, proven-in-use and ISO PAS 8926, and guard Linux with external safety mechanisms.
- SoftwareSW Critical Path & Dependent Failure AnalysisLearn how to identify safety-critical software execution paths and prioritize verification effort where it matters most. Covers control flow analysis, dependent failure analysis (DFA), and strategic placement of safety mechanisms.
- Safety analysesFMEA Mastery for Functional SafetyLearn bottom-up failure mode analysis to identify single-point, residual, and latent faults in your system. Covers scoping, severity/occurrence rating, diagnostic coverage linkage, and integration with SPFM/LFM calculations.