MISRA-C diary(C言語日誌)

2013年4月の記事一覧

ISO/IEC 9899:1999 to ISO/IEC 9899:2011

ISO/IEC 9899:1999 と ISO/IEC 9899:2011の違いについて考えるために、
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
の差から出発する。

目次からすると
6. Language
6.2 Concepts に
6.2.8 Alignmentofobjects
が追加。

6.7 Declarationsに
6.7.5 Alignmentspecifier
6.7.10 Staticassertions
が追加。

7. Library に
7.15 Alignment <stdalign.h>
7.17 Atomics<stdatomic.h>
7.23_Noreturn<stdnoreturn.h>
7.26 Threads<threads.h>
7.28 Unicodeutilities<uchar.h> 
が追加。

7.31 Futurelibrarydirections に
7.31.4 Floating-pointenvironment<fenv.h>
7.31.8 Atomics<stdatomic.h>
7.31.8 Atomics<stdatomic.h>
7.31.15 Threads<threads.h>
が追加

Annex B (informative) Library summaryに
B.14 Alignment <stdalign.h>
B.22_Noreturn<stdnoreturn.h>
B.25 Threads<threads.h>
B.27 Unicodeutilities<uchar.h>

Annex K (normative) Bounds-checking interfaces を追加。

なお、Annex J(informative)のPortability issuesでの項目ごとの違いは、

N1256にあってN1570にないもの。
J.1 Unspecified behavior
- Whether errno is a macro or an identifier with external linkage (7.5).
J.2 Undefined behavior
- An attempt is made to modify the result of a function call, a conditional operator, an assignment operator, or a comma operator, or to access it after the next sequence point (6.5.2.2, 6.5.15, 6.5.16, 6.5.17).

N1570にあってN1256にないもの(追加)
J.1 Unspecified behavior
-The values of objects that are neither lock-free atomic objects nor of type volatile sig_atomic_t and the state of the floating-point environment, when the processing of the abstract machine is interrupted by receipt of a signal (5.1.2.3).
- Whether a comparison macro argument that is represented in a format wider than its semantic type is converted to the semantic type (7.12.14).
- Whether a call to the atexit function that does not happen before the exit function is called will succeed (7.22.4.2).
— Whether a call to the at_quick_exit function that does not happen before the quick_exit function is called will succeed (7.22.4.3).
— Whether an encoding error occurs if a wchar_t value that does not correspond to a member of the extended character set appears in the format string for a function in 7.29.2 or 7.29.5 and the specified semantics do not require that value to be processed by wcrtomb (7.29.1).
J.2 Undefined behavior
— The execution of a program contains a data race (5.1.2.4).
— A program requires the formation of a composite type from a variable length array type whose size is specified by an expression that is not evaluated (6.2.7).
— An lvalue designating an object of automatic storage duration that could have been declared with the register storage class is used in a context that requires the value of the designated object, but the object is uninitialized. (6.3.2.1).
— A member of an atomic structure or union is accessed (6.5.2.3).
— A function declared with a _Noreturn function specifier returns to its caller (6.7.4).
— The definition of an object has an alignment specifier and another declaration of that
object has a different alignment specifier (6.7.5).
— Declarations of an object in different translation units have different alignment specifiers (6.7.5).
— The signal function is used in a multi-threaded program (7.14.1.1).
— The number of input items assigned by a formatted input function is greater than INT_MAX (7.21.6.2, 7.29.2.2).
— The alignment requested of the aligned_alloc function is not valid or not supported by the implementation, or the size requested is not an integral multiple of the alignment (7.22.3.1).
— A signal is raised while the quick_exit function is executing (7.22.4.7).
— At least one member of the broken-down time passed to asctime contains a value outside its normal range, or the calculated year exceeds four digits or is less than the year 1000 (7.27.3.1).
J.3 Implementation-defined behavior
J.3.2 Environment
— Whether a program can have more than one thread of execution in a freestanding environment (5.1.2.4).
J.3.4 Characters
— Whether differently-prefixed wide string literal tokens can be concatenated and, if so, the treatment of the resulting multibyte character sequence (6.4.5).
— The encoding of any of wchar_t, char16_t, and char32_t where the corresponding standard encoding macro (__STDC_ISO_10646__, __STDC_UTF_16__, or__STDC_UTF_32__) is not defined (6.10.8.2).
J.3.9 Structures, unions, enumerations, and bit-fields
— Whether atomic types are permitted for bit-fields (6.7.2.1).
J.3.13 Architecture
— The result of attempting to indirectly access an object with automatic or thread storage duration from a thread other than the one with which it is associated (6.2.4).
— Valid alignment values other than those returned by an _Alignof expression for fundamental types, if any (6.2.8).
J.5 Common extensions
J.5.6 Other arithmetic types
Additional floating types may also have less range or precision than float.

0

MISRA-C 2012

MISRA-C 2012 Referenceに掲載している文献の入手可能性を確認するための記録です。
記載間違い、勘違いなどがありましたらご連絡くださると幸いです。

番号の後ろにJをつけたものは該当する翻訳または日本語の解説です。
JISはJISCでweb閲覧ができます。

9. References

[1] MISRA Guidelines for the Use of the C Language in Vehicle Based Software, ISBN 0-9524159-9-0, Motor Industry Research Association, Nuneaton, April 1998
[1]J  テクニカルペーパー TP-01002 自動車用C言語利用のガイドライン(第2版),自動車技術会
[1]J' MISRA-C 解説書

[2] ISO/IEC 9899:1990, Programming Languages - C, International Organization for Standardization, 1990
[2]J JISX3010:1996, プログラミング言語C, 日本規格協会(閲覧は日本工業標準調査会)

[3]. Hatton L., Safer C

[4]. ISO/IEC 98991990/COR 1: 1995, Technical Corrigendum 1, 1995

[5]. ISO/IEC 9899:1990/AMD 1: 1995, Amendment 1, 1995

[6]. ISO/IEC 9899:1990/COR 2:1996, Technical Corrigendum 2, 1996

[7] ANSI X 3.159-1989, Programming languages - C, American National Standards Institute, 1989
(ISO/IEC 9899の原案としてISO/IEC JTC1に提案)

[8]. ISO/IEC 9899:1999, Programming languages - C, International Organization for Standardization, 1999
[8]J, JISX3010:2003, プログラミング言語C, 日本規格協会(9のCOR1に基づく)(閲覧は日本工業標準調査会)

[9]. ISO/IEC 9899:1999/COR 1: 2001, Technical Corrigendum 1, 2001
8Jに吸収

[10]. ISO/IEC 9899:1999/COR 2: 2004, Technical Corrigendum 2, 2004

[11]. ISO/IEC 9899:1999/COR 3: 2007, Technical Corrigendum 3, 2007

[12] ISO/IEC 9899:1999 Committee Draft WG14/N1256, Programming Languages - C, International Organization for Standardization, September 2007
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

[13]. ISO/IEC 9899:2011, Programming languages - C, International Organization for Standardization, 2011

[14] ISO/IEC 9899:2011/COR 1: 2012, Technical Corrigendum 1, 2012

[15] MISRA Development Guidelines for Vehicle Based Software, ISBN 0-9524156-0-7, Motor Industry Research Association,, Nuneaton, November 1994
[15]J, テクニカルペーパー TP-01001  自動車用ソフトウェアの開発ガイドライン,自動車技術会, 

[16] MISRA AC AGC: Guidelines for the application of MISRA-C:2004 in the context of automatic code generation, ISBN 978-906400-02-6 (PDF), November 2007.

[17] MISRA AC GMG: Generic modelling design and style guidelines, ISBN 978-906400-06-4 , May 2009.

[18] 
MISRA AC SLSF: Modelling design and style guidelines for the application of Simulink and Stateflow, ISBN 978-906400-07-1 (PDF), May 2009.

[19] MISRA AC TL: Modelling style guidelines for the application of TargetLink in the context of automatic code generation, ISBN 978-906400-01-9 (PDF), November 2007.

[20]  CRR80, The Use of Commercial Off-the Shelf(COTS) Software in Safety Related Applications, ISBN 0-7176-0984-7, HSE Books

[21] ISO 9001:2008, Quality management systems - Requirements, International Organization for Standardization, 2008
[21]J JIS Q 9001:2008 品質マネジメントシステム 要求事項, 日本規格協会(閲覧は日本工業標準調査会)

[22] ISO 90003:2004, Software engineering - Guidelines for the application of ISO 9001:2000 to computer software, ISO, 2004

[23] ISO 26262: 2011, Road vehicles - Functional safety, ISO, 2011

[24] DO-178C/ED-12C, Software Considerations in Airborne Systems and Equipment Certification, RTCA, 2011

[25] The TickIT Guide, Using ISO 9001:2000 for Software Quality Management System Construction, Certification and Continual Improvement, Issue5, Brithsh Standards Institution, 2001
Ts1: 2000: Issue 5.0 of the Tickit Guide
The Stationery Office
Institution of Engineering and Technology
値段:¥ 9,689

[26] Straker D., C Style: Standards and Guidelines, ISBN 0-13-116898-3, Prentice Hall 1991
[27] Fenton N. E. and Pfleeger S.L, Software Metrics: A Rigorous and Practical Approach, 2nd Edition, ISBN 0-534-95429-1, PWS, 1998

Software Metrics: A Rigorous and Practical Approach
Norman E. Fenton, Shari Lawrence Pfleeger
Course Technology Ptr (Sd)(1998/02/24)
値段:¥ 4,881


Software Metrics: A Rigorous and Practical Approach, Third Edition
Norman Fenton, James Bieman
CRC Press(2013/03/08)
値段:¥ 7,321

[28] MISRA Report 5, Software Metrics, February 1995.

[29] MISRA Report 6, Verification and Validation, February 1995.

[30] Kernighan B.W., Ritchie D.M., THe C programming language, 2nd edition ISBN 0-13-110362-8, Prentice Hall, 1998 
C Programming Language (2nd Edition)
Brian W. Kernighan, Dennis Ritchie
Prentice Hall(1988/03/22)

[30]J
プログラミング言語C 第2版 ANSI規格準拠
B.W. カーニハン, D.M. リッチー
共立出版(1989/06/15)
値段:¥ 2,940


[31] Koening A., C traps and Pitfalls, ISBN 0-201-17928-8, Addison-Wesley, 1988
C Traps and Pitfalls
Andrew Koenig
Addison-Wesley Professional(1989/01/01)
値段:¥ 4,186

[31].J 
Cプログラミングの落とし穴 (新紀元社情報工学シリーズ)
A. コーニグ
新紀元社(2004/01)
値段:¥ 2,415


[32] IEC 61508:2010, Functional safety of electrical/electronic/programmable electronic safety- related systems, International Electoromechanical Commission(IEC), 2010 part7まで
[32]J JIS C 0508 2012, 電気・電子・プログラマブル電子安全関連系の機能安全, 日本規格協会, part1からpart7まで(閲覧は日本工業標準調査会)

[33] EN 50128:2011, Railway applications - Communications, signalling and processing systems - Software for railway control and protection, CENELEC, 2011

[34] IEC 62304: 2006, Medical device software - Software life cycle processes, IEC, 2006
[34]J, JIS T 2304:2012 医療機器ソフトウェア―ソフトウェアライフサイクルプロセス, 日本規格協会, 2012(閲覧は日本工業標準調査会)

[35] ANSI/IEEE std 754, IEEE Standard for Binary Floating-Point Arithmetic, 1985
IEEE Standard for Binary Floating-Point Arithmetic
Ieee(1985/06)
値段:¥ 634

[36] ISO/IEC 10646:2003, Information technology - Universal Multiple-Octet Coded Character Set(UCS), ISO, 2003
[36]J JIS X 0221,:2007, 国際符号化文字集合(UCS) ,2007, 日本規格協会 (ISO/IEC 10646 Amd1:2005, Amd2,2006に基づいている)(閲覧は日本工業標準調査会)

[37] Goldberg D., What Every Computer Scientist Should Know about Floating-Point Arithmetic, Computing Surveys, March 1991
https://ece.uwaterloo.ca/~dwharder/NumericalAnalysis/02Numerics/Double/paper.pdf

[38] Software Engineering Center, Information-technology Promotion Agency, Japan(IPA/SEC), Embedded System development Coding Reference(ESCR) [C language edition] Version 1.1, SEC Books, 2012

0