What is the intention of the rule 18-0-1?

Moderators: david ward, misra cpp

Post Reply
nakagawat
Posts: 5
Joined: Wed Sep 03, 2008 11:52 pm
Company: Toyo Corporation

What is the intention of the rule 18-0-1?

Post by nakagawat » Thu Sep 11, 2008 2:03 pm

The Rule 18-0-1 of the MISRA-C++:2008 prohibits developers from using
C libraries entirely. At the same time, the 'Rationale' section of this
rule admits the use of the C++ libraries which correspond to C libraries.

Many of the C++ libraries corresponding to C libraries are defined
as the C libraries surrounded by the std namespace. For the reason,
we think even if the C++ libraries corresponding to C libraries
are used, it is impossible to avoid such vulnerability C libraries
have as undefined behavior and unspecified behavior.

Why does the Rule 18-0-1 admit the use of the C++ libraries corresponding
to C libraries?

misra cpp
Posts: 151
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: What is the intention of the rule 18-0-1?

Post by misra cpp » Wed Oct 07, 2015 10:01 am

In some cases, C++ places additional requirements for its library resulting in a slightly different library to that of C. For example, the cmath header adds overloads.

The goal of 18-0-1 is to ensure that such differences are visible and so "the C++ library" be used. Other rules in the section cover specific issues with the features provided by the library.
Posted by and on behalf of
the MISRA C++ Working Group

Post Reply

Return to “6.18 Language support library (C++)”