Download [slides] Misra C Software Development Standard PDF

Title[slides] Misra C Software Development Standard
File Size170.0 KB
Total Pages24
Table of Contents
                            Outline
Introduction
	What is MISRA C
	Software Reliability Program
Reliability Coding Guidelines
	Overview
	Rules in Practice
	Extract from the guidelines
	Code Examples
Applications
	Tools
	Criticsm
Further readings
                        
Document Text Contents
Page 1

Outline
Introduction

Reliability Coding Guidelines
Applications

Further readings

Misra C Software Development Standard

Vittorio Giovara

Politecnico di Torino

Software Engineering

03/10/2008

Vittorio Giovara Misra C Software Development Standard

Page 2

Outline
Introduction

Reliability Coding Guidelines
Applications

Further readings

Creative Common Licence v3.0 Attribution - ShareAlike

You are free

to copy, distribute, display, and perform the work

to make derivative works

to make commercial use of the work

Under the following conditions

Attribution. You must give the original author credit.

Share Alike. If you alter, transform, or build upon this work,
you may distribute the resulting work only under a license
identical to this one.

For any reuse or distribution, you must make clear to oth-
ers the license terms of this work.

Any of these conditions can be waived if you get permission from
the copyright holder.

Vittorio Giovara Misra C Software Development Standard

Page 12

Outline
Introduction

Reliability Coding Guidelines
Applications

Further readings

Overview
Rules in Practice
Extract from the guidelines
Code Examples

Character encoding

Use of characters are required to be in the source character set. This
excludes the characters $ and @, among others.

signed char dollar = ’$’;

signed char esc_m = ’\m’;

Undefined behaviour for a not defined escape sequence.

Vittorio Giovara Misra C Software Development Standard

Page 13

Outline
Introduction

Reliability Coding Guidelines
Applications

Further readings

Overview
Rules in Practice
Extract from the guidelines
Code Examples

Object Identifiers

Declarations of identifiers denoting objects should have the narrowest
block scope unless a wider scope is necessary.

typedef int MY_INT;

static MY_INT use_me;
extern MY_INT abuse_me;

extern func(MY_INT *);
extern MY_INT ei_1, ei_2;

void f(void){
use_me++;

}

void g(void){
abuse_me++;

}

void MISRA_version_2(void){
MY_INT local = 3;

if (ei_1){
local+=ei_1;
ei_2=local;
func(&local);
ei_1+=local;
}

ei_1=33;
}

Vittorio Giovara Misra C Software Development Standard

Page 23

Outline
Introduction

Reliability Coding Guidelines
Applications

Further readings

Tools
Criticsm

Some common problems

Even though MISRA provides a very high quality set of guidelines,
there are yet some basic problems involved.

Some technical inaccuracies involving the C language

Problems with the C Standard clause used as the source of
coding guidelines.

Wording of some rules sometimes causes misunderstandings.

No support for C99 standard or other languages.

Vittorio Giovara Misra C Software Development Standard

Page 24

Outline
Introduction

Reliability Coding Guidelines
Applications

Further readings

Please visit as reference
http://www.misra.org.uk/

http://www.misra-c2.com/

http://www.knosof.co.uk/misracom.html

http://en.wikipedia.org/wiki/MISRA_C

Original document localized at
http://www.scribd.com/people/view/59403

Vittorio Giovara Misra C Software Development Standard

http://www.misra.org.uk/
http://www.misra-c2.com/
http://www.knosof.co.uk/misracom.html
http://en.wikipedia.org/wiki/MISRA_C
http://www.scribd.com/people/view/59403

Similer Documents