<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Issue 3370: &sect;[cstdint.syn]p2 and &sect;[headers]p5 are not sufficiently clear</title>
<meta property="og:title" content="Issue 3370: &sect;[cstdint.syn]p2 and &sect;[headers]p5 are not sufficiently clear">
<meta property="og:description" content="C++ library issue. Status: New">
<meta property="og:url" content="https://cplusplus.github.io/LWG/issue3370.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#New">New</a> status.</em></p>
<h3 id="3370"><a href="lwg-active.html#3370">3370</a>. &sect;[cstdint.syn]p2 and &sect;[headers]p5 are not sufficiently clear</h3>
<p><b>Section:</b> 17.4.1 <a href="https://wg21.link/cstdint.syn">[cstdint.syn]</a>, 16.4.2.3 <a href="https://wg21.link/headers">[headers]</a> <b>Status:</b> <a href="lwg-active.html#New">New</a>
 <b>Submitter:</b> Dawid Pilarski <b>Opened:</b> 2020-01-14 <b>Last modified:</b> 2020-01-25</p>
<p><b>Priority: </b>3
</p>
<p><b>View all other</b> <a href="lwg-index.html#cstdint.syn">issues</a> in [cstdint.syn].</p>
<p><b>View all issues with</b> <a href="lwg-status.html#New">New</a> status.</p>
<p><b>Discussion:</b></p>
<p>
This issue has been submitted, because the editorial change requests 
<a href="https://github.com/cplusplus/draft/issues/3521">c++-draft-issue 3521</a> and
<a href="https://github.com/cplusplus/draft/pull/3528">c++-draft-pull request 3528</a>
has been rejected as not being editorial changes:
</p>
<p>
Currently given wording of 17.4.1 <a href="https://wg21.link/cstdint.syn">[cstdint.syn]</a>p2:
</p>
<blockquote><p>
The header defines all types and macros the same as the C standard library header <code>&lt;stdint.h&gt;</code>.
</p></blockquote>
<p>
might be understood as intended: typedefs inside <code>stdint.h</code> and inside <code>cstdint</code> in namespace 
<code>std::</code> refer to the same types, but another interpretation could be, that it's understood as:
<p/>
Definitions in both files are done the same way (<code>cstdint</code> provides typedefs not in namespace 
<code>std</code>, because it would be a different definition than one in <code>stdint.h</code>).
<p/>
Also 16.4.2.3 <a href="https://wg21.link/headers">[headers]</a>p5 is non sufficiently clear:
</p>
<blockquote><p>
[&hellip;] the contents of each header <code>c<i>name</i></code> is the same as that of the corresponding header 
<code><i>name</i>.h</code> [&hellip;]
</p></blockquote>
<p>
As it doesn't say what does "same content" mean. For example is an implementation allowed to do following:
</p>
<blockquote><pre>
// __impl.h
typedef int __my_int;
namespace std { typedef long __my_int; }

// cname header
#include "__impl.h"

namespace std {
  typedef __my_int uint32_t;
}

// name.h header
#include "__impl.h"
typedef __my_int uint32_t;
</pre></blockquote>
<p>
? 
<p/>
In this case typedef from namespace <code>std</code> and from global namespace refer to different types?
<p/>
Proposed change:
<p/>
Apply wording, that will unambiguously make typedefs from namespace <code>std</code> refer to the same types 
as typedefs from global namespace for all headers <code><i>name</i>.h</code> and their corresponding headers 
<code>c<i>name</i></code>.
</p>

<p><i>[2020-01-25 Issue Prioritization]</i></p>

<p>Priority to 3 after reflector discussion.</p>

<p id="res-3370"><b>Proposed resolution:</b></p>





</body>
</html>
