Skip to main content
Black FridayBlack Friday: Extra 10% off Pro and Expert
BLACKFRIDAY10
Ends in 7d 22h 56mSee the plans

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.

Concept guide · ISO 26262-6 + MISRA · 16 chapters

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
iso26262.academy/concepts/functional-safety-concept
The Functional Safety Concept guide in the Academy, as an example of a full guide.
An example of a full guide: the Functional Safety Concept guide in the Academy, with its chapter grid and first lesson.

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

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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. 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. 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. 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. 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. 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. 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. 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 pricing

Figures 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

A deviation is a documented, justified decision to violate a specific guideline at a specific location, the pressure valve that keeps a rule set enforceable. A sound record identifies the guideline and the code location, explains why compliance is not reasonable there, assesses the safety impact, and names the measures that address the guideline's underlying risk. It needs review and approval, not just a suppression comment. Under MISRA compliance rules a Mandatory guideline cannot be deviated at all, so the process applies to Required guidelines, while Advisory findings follow the documented project policy.
MISRA C targets safety: it constrains C to a predictable subset by banning constructs with undefined or implementation-defined behavior that make code unanalyzable. CERT C targets security: its rules address exploitable weaknesses and are categorized by severity and likelihood. The overlap is substantial (buffer overflows and integer overflows are both safety and security problems) so the two complement each other, and with ISO 21434 pushing cybersecurity into automotive projects, many teams now enforce MISRA C as the base with safety-relevant CERT C rules layered on top.
Sixteen chapters covering why coding standards exist, the Part 6 map, the C and C++ subsets, project guidance topic by topic, unit design principles, structural coverage, dead and deactivated code, verifiable coding patterns, analyser metrics, floating-point and fixed-point arithmetic, AUTOSAR Classic integration, toolchain configuration, the workflow from commit to safety case, and the traps to avoid. Reading paths point each role to its starting chapter. A free account starts you off, and the Pro and Expert plans unlock more of the library.

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

Browse all 109 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.Expert plan pricing13 chapters
  • 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.Expert plan pricing7 chapters
  • 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.Expert plan pricing13 chapters