MISRA C Support

MISRA C

MISRA C is a formal set of guidelines for programming in the C language. These guidelines, published by the Motor Industry Software Reliability Association (MISRA), identify aspects of the C language that should be avoided due to their ambiguity and susceptibility to common programming mistakes. Each guideline is documented with background reasoning, examples, and justification.

By following this well-researched set of rules and documented set of safe programming practices, the risk of writing bad or error-prone code can be significantly reduced. As a result, a better, safer system can be developed and the time lost finding bugs can be reduced.

The cost of flexibility
The C language is probably the most widely-used highlevel language in embedded systems today. This is largely due to its incredible flexibility: C is available for a huge range of systems and can implement virtually any type of software application.

This flexibility comes at a cost however. Ambiguities in the C language, along with certain syntaxes, consistently trip up even the best programmers and result in bugs. For software developers, this means a large amount of unexpected time spent finding bugs. For managers, this often means the single largest risk to their project.

Achieving productivity
While MISRA C is a set of guidelines for a software developer, it is not a specification for a compiler. Therefore, developers can painstakingly enforce these rules themselves through inspection. But to realize true productivity, these manual steps must be automated and consistently enforced.

The MULTI Integrated Development Environment offers this exact capability.

Extensive coverage
Green Hills Software supports MISRA C in standard release of all 32- and 64-bit products, including MULTI for ARM, V850, Power Architecture, MIPS, Intel Architecture and others.

Green Hills is also uniquely qualified to support the largest number of MISRA C rules for embedded development through its Optimizing Compilers and Advanced Run-time Error Detection.

Green Hills supports MISRA-C:1998 and MISRA-C:2004, as well as the latest MISRA specification: MISRA-C:2012.

Example of C's Ambiguity
if (flag && (total=num++))
 
The programmer here originally intended to compare total and num++. But instead, an unexpected assignment was done and a completely different Boolean expression was evaluated.
 
Furthermore, even if = was changed to ==, will num be incremented? If flag is false, it wouldn't.

C Compiler, embedded c, Infotainment, Powertrain, Drivetrain, Chassis, MISRA C Compilers, MISRA C, Embedded E, Embedded Development Tools, Toolchain

Click here for a larger view

The MULTI Integrated Development Environment

MULTI provides a host-based (Windows, Solaris, and Linux) graphical environment for embedded target development.

MULTI offers a comprehensive set of advanced development tools. While, these tools provide powerful capabilities separately, their real strength is derived from their tight integration. Changes made in one component are automatically reflected in every other, enhancing developer productivity and resulting in higher-quality code.

Optimizing compilers

MULTI features

  • Source Level Debugger
  • Graphical Project Builder
  • Text Editor
  • Version Control System
  • Graphical Browser
  • Performance Profiler
  • Run-time Error Checking
  • TimeMachine Debugging Suite
  • DoubleCheck Source Code Analysis
  • Remote Target Connection

MULTI for MISRA C
With MULTI, developers can select exactly which MISRA C rule to enforce. The selection can be done graphically or from the command line. At compile time, violations of MISRA C rules are reported. Violations that can only be detected at run-time are automatically detected and reported by Green Hills advanced run-time error detection.

Across industries

MISRA C has been developed to address the critical need for reliable systems in the automotive industry. It achieves this by formally identifying good programming practices and types of C code susceptible to error. Implementing these guidelines has a direct effect on the reliability of a final system. Regardless of the industry or application, the ability to consistently detect and reduce errors will significantly reduce time spent debugging.

© 1996-2024 Green Hills Software Privacy Policy Cookies Policy Copyright & Patent Notices