An introduction to the SuperTest MISRA suites

The SuperTest MISRA suites are created to verify the conformance of MISRA checking software. The aim of a, so-called, MISRA checker is to check application software for its compliance with the MISRA guidelines.  The SuperTest MISRA suites in turn verify that such a MISRA checker generates the right diagnostics and not too many false positives or false negatives.

The MISRA suites contain two types of tests: those which a name starting with an 'x', and those which a name that starts with a 't'.


The so-called t-tests are fully conforming with the MISRA guidelines and should not trigger any diagnostics in the MISRA checking software. This is an example of a t-test:


  * Test for MISRA-C:2004 Rule 4.2:

  *     Trigraphs shall not be used


 typedef signed int int32_t;

 static int32_t fun (void);

 static int32_t fun (void) {

     char r[50] = "OK: ??? ??.??+??~??^"; /* Compliant */

     return (r[0] != 'O') ? (int32_t)1 : (int32_t)0;


 int32_t main (void) {

     return fun ();


In this test, the string that initializes the variable r[50] contains a number of character sequences that look like trigraph sequences, which the MISRA guidelines do not allow, but are not trigraphs. Hence, this code is compliant with MISRA Rule 4.2. No diagnostic should be given. The code is also constructed so that no other MISRA rules are violated.


The x-tests contain a violation of one of the MISRA rules. When passed to a MISRA checker, they should trigger a diagnostic for a specific rule. Here is an example of an x-test that violates Rule 5.4, which requires that tags are unique.


  * Test for MISRA-C:2004 Rule 5.4:

  *     A tag name shall be a unique identifier


  * Notes on test:

  * Check that the following code violates MISRA Rule 5.4


 typedef unsigned short uint16_t;

 typedef signed int int32_t;

 typedef unsigned int uint32_t;

 int32_t main (void) {

     uint32_t aval;


         enum thetag { x, y, z };

         enum thetag ty = y;

         aval = (ty < x) ? (int32_t)1U : (int32_t)0U;



         struct thetag {   /* Not compliant */

             uint16_t a;

             uint16_t b;

         } str = {3U, 4U};

         aval += str.a;


     return (aval != 3U) ? (int32_t)1 : (int32_t)0;


Note that this x-test is perfectly fine C90 code. C90 allows the reuse of thetag in different scopes. But MISRA does not.

A big effort has been put into making the x-tests as specific as possible, so that they contain only one rule violation, and at the same time keep them concise and understandable. This is not always possible. Sometimes rules partially overlap and an additional diagnostic is triggered.

Undecidable Rules

Some of the MISRA rules are what is called undecidable.  This means that for complex examples of such code, a MISRA checker may not be able to follow the control and data flow with sufficiently detail to decide if a rule is violated or not. For such rules, there are often 'trivial' cases for which a MISRA checker is expected to give a diagnostic. We have tried to include such trivial cases in the suites as well. We have also tried to include more complex cases that are decidable with some effort. The following is an example of a t-test for an undecidable rule, so it should not give a diagnostic:


  * Test for MISRA-C:2004 Rule 17.3:

  *     >, >=, <, <= shall not be applied to pointer

  *     types except where they point to the same array


  * Notes on test:

  * Check that the code does not violate MISRA Rule 17.3


 typedef signed int int32_t;

 int32_t main (void) {

     int32_t a[] = {1, 2, 3};

     int32_t *pa = &a[1];

     int32_t r = 9;

     if (&a[2] > pa) {   /* Compliant */

         r = 6;


     return r - 6;


To verify that the pointer comparison is compliant, requires that a MISRA checker applies non-trivial data flow analysis to the code. If the MISRA checker cannot do that, it might decide to play it safe and generate a false positive: an incorrect diagnostic for a (possible) rule violation. MISRA checker may offer options to suppress false positives.

The MISRA test suite comes in several flavors. By means of (advisory) Rule 6.3, MISRA forces application developers to choose a data model and express that choice in the primitive types used for arithmetic. This can be seen in the examples above, which use the 32-bit integer type "int32_t".

The MISRA suites are supplied both in a generic form and in a form that is specific for a data model. The examples above are all for a specific data model. In the generic form, the previous example looks like this:

 int main (void) {

     int a[] = {1, 2, 3};

     int *pa = &a[1];

     int r = 9;

     if (&a[2] > pa) {   /* Compliant */

         r = 6;


     return r - 6;


In this form, one should tell the MISRA checker that it should ignore Rule 6.3.

Solid Sands can also provide additional instances of the MISRA suites that are specific for another data model, if needed.

Extracts of the MISRA C guidelines used with permission of HORIBA MIRA LIMITED. MISRA is a registered trademark of HORIBA MIRA LIMITED.

For example test code:
(c) Copyright 2015-2017 by Solid Sands B.V.,   
Amsterdam, the Netherlands. All rights reserved.
Subject to conditions in the RESTRICTIONS file.
Copyright (c) 2015 Analog Devices, Inc.  All rights reserved.

(c) Copyright 2017 by Solid Sands B.V., Amsterdam, the Netherlands
SuperTest™ is a trademark of Solid Sands B.V., Amsterdam, The Netherlands.


The Benefits of C and C++ Compiler Qualification

In embedded application development, the correct operation of the compilation toolset is critical to the functional safety of the application. Two options are available to build trust in the corre...

8 Ways to Improve Harness Manufacturing

Harness manufacturing is a low margin business where quality, accuracy, and speed are essential to success. It can benefit from a full, automated and digitally continuous flow from product design to h...

General principles of PCBs design

How to design PCBs correctly, to reach boards which are cost-effective to produce and to populate? Which are the most important PCB design principles? What about production technology of PCB? We have ...

The Next Level of Embedded Software Development

With the rapid expansion of complex technology into everyday life, the importance of software is growing exponentially. This complimentary webinar presented by Siemens PLM Software will show how emb...

Embedded Software for Safety Critical Applications

Production code generation with Model-Based Design has replaced document-based development and manual coding in various domains in automotive, industrial automation, aerospace and medical. Safety-rela...

Coding safe and secure applications

The debate about safety and security concerns in high integrity software applications is a hot topic of discussion in modern software management. The need to address these concerns is present in e...

Best practices for static analysis tools

This paper reviews a number of the growing complexities that embedded software development teams are facing, including the proliferation of third-party code, increased pressures to develop secure ...

Wireless networking and security for IoT devices

David Brook, marketing director with HCC Embedded, shares an update on two of the company's main focus areas: wireless networking for IoT devices and security for those networked IoT devices. ...

Fluffing the Cloud

The synergistic development aspect of electronic design was very apparent these past weeks at the APEC and Embedded World shows, as engineers from around the globe came together in San Antonio, Texas,...

Best practices for safer systems

Hear industry expert and Barr Group CTO Michael Barr discuss the latest startling statistics concerning embedded systems safety from Barr Group’s newly released 2018 Embedded Systems Safety ...

Coding safe and secure applications

The world is becoming far more connected, and systems are vulnerable to malicious attacks via these connections. Safety and security are different, but there are some common ways to achieve them i...

Data Distribution Service in autonomous car design

Builders of autonomous vehicles face a daunting challenge. To get a competitive edge, intelligent vehicle manufacturers must deliver superior driving experience while meeting demanding requirement...

Nine Steps to Choosing The Right Coding Standard

Selecting the right coding standard is an essential building block for safe and secure coding. While superficially many coding standards and automatic analysis tools may look similar, they can be quit...


Embedded HMIs and SBCs “Made in Germany”

You are looking for a HMI-system or single components as touches, displays and ARM-based SBCs? Welcome at Garz & Fricke – the Embedded HMI Company! Our offering ranges from typical single co...

ECRIN Systems myOPALE: Remote Embedded Modular Computers

myOPALE™ offers disruptive technology to multiply capabilities of your next Embedded Computers in a smaller foot print thanks to PCI Express® over Cable interconnect, standard 5.25’&rs...

TechNexion rolls out embedded systems, modules, Android Things kits at Embedded World 2018

In this video John Weber of TechNexion talks to Alix Paultre about how the company helps its customers getting products to market faster. By choosing to work with TechNexion, developers can take advan...

TechNexion rolls out embedded systems, modules, Android Things kits at Embedded World 2018

In this video John Weber of TechNexion talks to Alix Paultre about how the company helps its customers getting products to market faster. By choosing to work with TechNexion, developers can take advan...

Integrated System Security by Winbond

Security is critical to embedded systems, and Winbond integrates reliable security into their boards that includes authentication and certification. Winbond products offer multiple security keys in th...

Silicon Labs Wireless Solutions at Embedded World 2018

At Embedded World 2018, Silicon Labs hosted a variety of demonstrations for their wireless portfolio. From Wi-Fi, to Bluetooth, to multiprotocol, their products are built to be robust and easy-to-impl...

Aetina shows intelligent Jetson and Pascal GPGPU solutions at Embedded World 2018

At this year’s Embedded World, Aetina has presented NVIDIA® Pascal™ GPU driven lineup on MXM, XMC, VPX, PCI- Express graphics cards and multi-displays variants. Their new rugged 3U ...

Arrow Electronics: Solutions and Design Integration

Arrow is moving in a very specific direction that includes design integration and being seen as a solutions provider in the tech industry. Sensor technology is a key component in this movement, as it ...

Arrow: Your Solution for the Future

Arrow doesn’t just offer components that customers use to build their designs – we offer engineering support, customized systems and technology platform solutions, and so much more. The pr...

SoMs & Engineering Solutions: What Arrow has to Offer

Arrow doesn’t just offer components that customers use to build their designs – we offer engineering support, customized systems and technology platform solutions, and so much more. The pr...

Arrow: The 5 Pillars of IoT

There are five pillars of IoT solutions, according to Ashish Parikh, VP of Global IoT Platforms & Solutions, Supplier Marketing. These pillars are Create, Connect, Analyze, Manage, and Sustain, an...

Arrow: Your Technology Provider

David Spragg has been with Arrow for the past three decades, and walks us through the company’s evolution from distributor to technology provider at Embedded World 2018. Watch the video to see h...

Sensor to Cloud – SimpleLink™ MCU Platform demo – embedded world 2018

At embedded world 2018, we showcased our interactive Sensor-to-Cloud demo, which utilizes a SimpleLink™ MSP432™ Ethernet-based gateway and allows us to interface with various cloud service...

mmWave people counting demo – embedded world 2018

Check out our demo on how TI’s mmWave sensors are enabling a smarter world. These devices can give us detection information about the range, velocity and angle information about the objects. Thi...

mmWave imaging radar for automotive applications – embedded world 2018

As OEMs are preparing for fully autonomous driving, the requirements for high angular resolution and high performance increase. This demo shows 4 cascaded mmWave sensors to achieve angular resolution ...

Capacitive touch with TI CapTIvate™ technology – embedded world 2018

Experience how capacitive touch sensing can enhance your design using the flexibility and robust performance of MSP430™ MCUs with CapTIvate™ technology. These demos showcase capacitive tou...

IOT/Industrie 4.0 – Edge to Fog to Cloud – TSN & OPC UA enabled

Kontron as a part of the S&T group offers a wide portfolio of IOT ready /Microsoft Azure certified platforms with Kontron Security solution APPROTECT on SMARC 2.0, COM Express®, Q7 modules and...

Secure Programming with SPARK

SPARK is a proven solution for developing advanced, verifiably secure software systems. Through the use of formal methods, SPARK Pro prevents, detects and eliminates defects early in the software life...

MEN Micro stands for flexible multicore solutions for mission-critical IIoT applications!

At Embedded World they presented their brand new cPCI Serial card with ARM Cortex A72, the Rugged COM Express module with AMD V1000. Klaus Weinert from MEN also explained the flexible system soluti...

Wind River Makes the Reality of a Software Defined World Safe, Secure, and Reliable

Wind River is a world leader in delivering software for IoT. The company offers the industry's most comprehensive embedded software portfolio, supported by world-class global professional services...

UDE brings new features for multicore debugging and smart system analysis

The new version 4.10 of PLS’s Universal Debug Engine (UDE) features a numerous completely new and improved functions for debugging, testing and system analysis of multicore applications. Trace d...

SECO at Embedded World 2018 - Cutting-Edge Embedded Solutions

At EW 2018 Michael Park presents SECO’s latest embedded products. SECO has 39+ years of experience in designing and manufacturing embedded systems: from standard products (Qseven®, COM Expre...

HCC WiFi Networking & Encryption for Embedded

HCC’s Director of Marketing David Brook discusses the role of software quality in development of HCCs EAP-TLS and CrytpoCore Suite. A strong development process is the key to low defect software...

ADLINK´s IoT Vision

A tour of the ADLINK booth at EW2018 with Steve Jennis, Head of Global Marketing. From the latest embedded boards to AI-at-the-Edge, Steve explains how ADLINK is enabling its customers to deploy indus...

ADLINK´s understanding of Leading EDGE COMPUTING

ADLINK’s Head of Global Marketing, Steve Jennis, interviewed on the technology and demonstrations on show at Embedded World 2018...covering Embedded, Edge, Fog and Cloud Computing and, in partic...

One specialization is not enough – Bonding technologies by DATA MODUL

More display variations and higher requirements in industrial applications present a challenge to display refiners. Today, mastering a single bonding process is not enough. Due to the generally rising...

Advantech at Embedded World, executive talk with HP Nüdling

Advantech, global leader in the Embedded IoT business is emphasizing on its global presence and its local know how. The new Competence center in Munich with its Design-in capabilities will help custom...