没有合适的资源?快使用搜索试试~ 我知道了~
首页C语言编程规范 MISRA C 2012
C语言编程规范 MISRA C 2012
2星 需积分: 50 158 下载量 132 浏览量
更新于2023-03-16
评论 6
收藏 308KB PDF 举报
主要是汽车电子行业c编程规范 MISRA C 2012 Addendum 1 - Rule Mapping
资源详情
资源评论
资源推荐
MISR A C:2012
Addendum 1 — Rule Mappings
March 2013
First published March 2013 by MIRA Limited
Watling Street
Nuneaton
Warwickshire
CV10 0TU
UK
www.misra.org.uk
© MIRA Limited 2013.
“MISRA”, “MISRA C” and the triangle logo are registered trademarks of MIRA Limited, held on behalf of
the MISRA Consortium.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or
transmitted in any form or by any means, electronic, mechanical or photocopying, recording or
otherwise without the prior written permission of the Publisher.
ISBN 978-1-906400-12-5 PDF
British Library Cataloguing in Publication Data
A catalogue record for this book is available from the British Library
1
MISRAC:2012 Addendum: RuleMappings
MISRAC:2004 to MISRAC:2012 rule mapping
MISRAC:2004 MISRAC:2012 Signicant changes from MISRAC:2004 for C90 code
Rule1.1 (required) Rule1.1 (required) The requirement that code conform to a version of
the standard has moved into an introductory section.
MISRAC:2004 Rule1.1 had an implied ban on extensions.
MISRAC:2012 Rule1.1 permits extensions, but they are
restricted by the new advisory Rule1.2.
Rule1.2 (advisory)
Rule1.2 (required) Rule1.3 (required) Relaxed to permit unspecied behaviour that is not
considered critical. MISRA C:2012 AppendixH lists the
issues that are covered.
Rule1.3 (required) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
Rule1.4 (required) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
Rule1.5 (advisory) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
Rule2.1 (required) Dir4.2 (advisory) Tightened to require documentation of assembly usage.
Dir4.3 (required)
Rule2.2 (required) Rule1.2 (advisory) Relaxed to permit // comments in C99 code.
Downgraded to advisory for C90.
Rule2.3 (required) Rule3.1 (required)
Rule2.4 (advisory) Dir4.4 (advisory) Changed to a directive as MISRAC:2012 does not precisely
describe what constitutes code in a comment.
Rule3.1 (required) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
Rule3.2 (required) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
Rule3.3 (advisory) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
It is not an issue for C99 because the standard species the
behaviour.
Rule3.4 (required) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
Rule3.5 (required) Dir1.1 (required) Changed to a directive as it is not a statically checkable rule.
Rule3.6 (required) Deleted This issue is now covered by the Introduction to the Rules
section.
Rule4.1 (required) Rule4.1 (required) Relaxed to permit octal and hexadecimal escapes providing
that they are properly terminated. C90Undened 11 (an
undened escape sequence is used) is now covered by
Rule1.3.
Rule4.2 (required) Rule4.2 (advisory) Downgraded to advisory because there is no undened
or unspecied behaviour associated with trigraphs. There
are certain source character sets in which it would be
impossible to write C programs without trigraphs.
Rule5.1 (required) Rule5.1 (required) Relaxed to permit the identiers to be distinct up to the
limit allowed by the implementation.
Rule5.2 (required)
Rule5.3 (required)
Rule5.4 (required)
Rule5.5 (required)
Rule5.2 (required) Rule5.3 (required)
2
MISRAC:2004 to MISRAC:2012 rule mapping
MISRAC:2004 MISRAC:2012 Signicant changes from MISRAC:2004 for C90 code
Rule5.3 (required) Rule5.6 (required) Relaxed to permit tag names that are the same as typedef
names.
Rule5.4 (required) Rule5.7 (required) Relaxed to permit tag names that are the same as typedef
names.
Rule5.5 (advisory) Rule5.8 (required) Relaxed to permit static identiers declared in a block to
have the same name as other identiers.
Rule5.9 (advisory)
Rule5.6 (advisory) Deleted Relaxed to permit identiers such as labels and
enumeration constants that are not in the same scope to
have the same identier.
Rule5.7 (advisory) Deleted Relaxed to permit identiers such as structure members
names in dierent structures.
Rule6.1 (required) Rule10.1 (required) Relaxed to allow addition of plain char and a dierent
integer type, and subtraction of two plain char.
Rule10.2 (required)
Rule10.3 (required)
Rule10.4 (required)
Rule6.2 (required) Rule10.1 (required)
Rule10.3 (required)
Rule10.4 (required)
Rule6.3 (advisory) Dir4.6 (advisory)
Rule6.4 (required) Rule6.1 (required) Relaxed to permit other legal C99 bit-eld types
Rule6.5 (required) Rule6.2 (required) Relaxed to permit unnamed bit-elds with a signed type to
be single-bit.
Rule7.1 (required) Rule4.1 (required) Relaxed to permit octal escape sequences providing they
are properly terminated.
Rule7.1 (required)
Rule8.1 (required) Rule8.2 (required) Tightened to require all function types to be in prototype
form with named parameters.
Relaxed to permit function denitions with no separate
declaration if they have internal linkage.
Rule8.4 (required)
Rule17.3 (mandatory)
Rule8.2 (required) Rule8.1 (required) Tightened to require all types to be explicitly stated,
e.g. structure members.
Rule8.3 (required) Rule8.3 (required)
Rule8.4 (required) Rule8.3 (required) Tightened to require identical object types
Rule8.5 (required) Deleted This rule has been deleted because some programming
paradigms require the presence of executable code in
a header le. It is also desirable for inline functions to
appear in header les so as to avoid undened issues. The
problems associated with multiple declaration/denition of
objects/functions are dealt with by other rules.
Rule8.6 (required) Deleted Relaxed to permit declarations using the extern keyword
at block scope, but more specic problems are caught by
other rules such as:
• Rule1.3: Undened behaviour due to use of the static
keyword
• Rule8.3: Compatibility of multiply-declared/dened
objects/functions
剩余15页未读,继续阅读
璨CAN
- 粉丝: 4
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 收起
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
会员权益专享
最新资源
- RTL8188FU-Linux-v5.7.4.2-36687.20200602.tar(20765).gz
- c++校园超市商品信息管理系统课程设计说明书(含源代码) (2).pdf
- 建筑供配电系统相关课件.pptx
- 企业管理规章制度及管理模式.doc
- vb打开摄像头.doc
- 云计算-可信计算中认证协议改进方案.pdf
- [详细完整版]单片机编程4.ppt
- c语言常用算法.pdf
- c++经典程序代码大全.pdf
- 单片机数字时钟资料.doc
- 11项目管理前沿1.0.pptx
- 基于ssm的“魅力”繁峙宣传网站的设计与实现论文.doc
- 智慧交通综合解决方案.pptx
- 建筑防潮设计-PowerPointPresentati.pptx
- SPC统计过程控制程序.pptx
- SPC统计方法基础知识.pptx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论3