<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 1449: Incomplete specification of header &lt;cinttypes&gt;</title>
<meta property="og:title" content="Issue 1449: Incomplete specification of header &lt;cinttypes&gt;">
<meta property="og:description" content="C++ library issue. Status: C++11">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue1449.html">
<meta property="og:type" content="website">
<meta property="og:image" content="http://cplusplus.github.io/LWG/images/cpp_logo.png">
<meta property="og:image:alt" content="C++ logo">
<style>
  p {text-align:justify}
  li {text-align:justify}
  pre code.backtick::before { content: "`" }
  pre code.backtick::after { content: "`" }
  blockquote.note
  {
    background-color:#E0E0E0;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  ins {background-color:#A0FFA0}
  del {background-color:#FFA0A0}
  table.issues-index { border: 1px solid; border-collapse: collapse; }
  table.issues-index th { text-align: center; padding: 4px; border: 1px solid; }
  table.issues-index td { padding: 4px; border: 1px solid; }
  table.issues-index td:nth-child(1) { text-align: right; }
  table.issues-index td:nth-child(2) { text-align: left; }
  table.issues-index td:nth-child(3) { text-align: left; }
  table.issues-index td:nth-child(4) { text-align: left; }
  table.issues-index td:nth-child(5) { text-align: center; }
  table.issues-index td:nth-child(6) { text-align: center; }
  table.issues-index td:nth-child(7) { text-align: left; }
  table.issues-index td:nth-child(5) span.no-pr { color: red; }
  @media (prefers-color-scheme: dark) {
     html {
        color: #ddd;
        background-color: black;
     }
     ins {
        background-color: #225522
     }
     del {
        background-color: #662222
     }
     a {
        color: #6af
     }
     a:visited {
        color: #6af
     }
     blockquote.note
     {
        background-color: rgba(255, 255, 255, .10)
     }
  }
</style>
</head>
<body>
<hr>
<p><em>This page is a snapshot from the LWG issues list, see the <a href="lwg-active.html">Library Active Issues List</a> for more information and the meaning of <a href="lwg-active.html#C++11">C++11</a> status.</em></p>
<h3 id="1449"><a href="lwg-defects.html#1449">1449</a>. Incomplete specification of header <code>&lt;cinttypes&gt;</code></h3>
<p><b>Section:</b> 31.8.3 <a href="https://wg21.link/istringstream">[istringstream]</a> <b>Status:</b> <a href="lwg-active.html#C++11">C++11</a>
 <b>Submitter:</b> Canada <b>Opened:</b> 2010-08-25 <b>Last modified:</b> 2016-01-28</p>
<p><b>Priority: </b>Not Prioritized
</p>
<p><b>View all issues with</b> <a href="lwg-status.html#C++11">C++11</a> status.</p>
<p><b>Discussion:</b></p>
<p><b>Addresses CA-4</b></p>

<p>
Subclause 27.9.2 [c.files] specifies that &lt;cinttypes&gt; has
declarations for abs() and div(); however, the signatures
are not present in this subclause. The signatures
proposed under TR1 ([tr.c99.inttypes]) are not present in
FCD (unless if intmax_t happened to be long long). It is
unclear as to which, if any of the abs() and div() functions
in [c.math] are meant to be declared by &lt;cinttypes&gt;. This
subclause mentions imaxabs() and imaxdiv(). These
functions, among other things, are not specified in FCD to
be the functions from Subclause 7.8 of the C Standard.
Finally, &lt;cinttypes&gt; is not specified in FCD to include
&lt;cstdint&gt; (whereas &lt;inttypes.h&gt; includes &lt;stdint.h&gt; in C).
</p>

<p><i>[
Post-Rapperswil, Daniel provides wording
]</i></p>


<p>
Subclause [c.files] specifies that <code>&lt;cinttypes&gt;</code> has declarations for <code>abs()</code> and <code>div()</code>; 
however, the signatures are not present in this subclause. The signatures proposed under TR1 ([tr.c99.inttypes]) are not 
present in FCD (unless if <code>intmax_t</code> happened to be <code>long long</code>). It is unclear as to which, if any of the 
<code>abs()</code> and <code>div()</code> functions in [c.math] are meant to be declared by <code>&lt;cinttypes&gt;</code>. This
subclause mentions <code>imaxabs()</code> and <code>imaxdiv()</code>. These functions, among other things, are not specified in 
FCD to be the functions from subclause 7.8 of the <code>C</code> Standard. Finally, <code>&lt;cinttypes&gt;</code> is not specified 
in FCD to include <code>&lt;cstdint&gt;</code> (whereas <code>&lt;inttypes.h&gt;</code> includes <code>&lt;stdint.h&gt;</code> in <code>C</code>).
</p>

<blockquote><p>
Moved to Tentatively Ready with proposed wording after 5 positive votes on c++std-lib.
</p></blockquote>

<p><i>[
Adopted at 2010-11 Batavia
]</i></p>




<p id="res-1449"><b>Proposed resolution:</b></p>
<p>
<i>The wording refers to N3126.</i>
</p>
<ol>
<li>Add the following series of new paragraphs following [c.files] p.1:
<blockquote><p>
Table 132 describes header <code>&lt;cinttypes&gt;</code>. [<em>Note</em>: The macros defined by <code>&lt;cinttypes&gt;</code> are provided unconditionally.
In particular, the symbol <code>__STDC_FORMAT_MACROS</code>, mentioned in footnote 182 of the <code>C</code> standard, plays no role in <code>C++</code>. 
&mdash; <em>end note</em> ]
<p/>
<ins>2 - The contents of header <code>&lt;cinttypes&gt;</code> are the same as the Standard <code>C</code> library header <code>&lt;inttypes.h&gt;</code>, 
with the following changes:</ins>
<p/>
<ins>3 - The header <code>&lt;cinttypes&gt;</code> includes the header <code>&lt;cstdint&gt;</code> instead of <code>&lt;stdint.h&gt;</code>.</ins>
<p/>
<ins>4 - If and only if the type <code>intmax_t</code> designates an extended integer type ([basic.fundamental]), the following function 
signatures are added:</ins>
</p>
<blockquote><pre>
<ins>intmax_t abs(intmax_t);</ins>
<ins>imaxdiv_t div(intmax_t, intmax_t);</ins>
</pre></blockquote>
<p>
<ins>which shall have the same semantics as the function signatures <code>intmax_t imaxabs(intmax_t)</code> and 
<code>imaxdiv_t imaxdiv(intmax_t, intmax_t)</code>, respectively.</ins>
</p>
</blockquote>
</li>
</ol>





</body>
</html>
