没有合适的资源?快使用搜索试试~ 我知道了~
C语言编程规范 MISRA C 2012
2星 需积分: 50 158 下载量 181 浏览量
2018-12-31
13:42:10
上传
评论 6
收藏 308KB PDF 举报
温馨提示
试读
16页
主要是汽车电子行业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页未读,继续阅读
资源评论
- yzhij2020-04-22谢谢楼主的分享资料
- 知识混子2022-02-23垃圾内容,骗积分的
- 脚踏实地-仰望星空2021-09-25不要下载,不完整。
璨CAN
- 粉丝: 4
- 资源: 19
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- TG-2024-04-26-183849310.mp4
- 汇编语言的概要介绍与分析
- 个人博客系统设计与开发.zip
- 2023-04-06-项目笔记 - 第一百十五阶段 - 4.4.2.113全局变量的作用域-113 -2024.04.26
- 2023-04-06-项目笔记 - 第一百十五阶段 - 4.4.2.113全局变量的作用域-113 -2024.04.26
- htmlzwbjq_downyi.com.zip
- 无头单向非循环链表的实现(Test.c)
- 无头单向非循环链表的实现(SList.c)
- 浏览器重定向插件更新文件
- SSA-BP麻雀算法优化BP神经网络多特征分类预测(Matlab实现完整源码和数据)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功