<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Support/DataTypes.h requires C99 defines even when compiling in C11 mode"
   href="http://llvm.org/bugs/show_bug.cgi?id=21472">21472</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Support/DataTypes.h requires C99 defines even when compiling in C11 mode
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Support Libraries
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>tilkax@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ echo '#include <llvm/Support/DataTypes.h>' | clang -std=c11 -xc -
In file included from <stdin>:1:
/usr/include/llvm/Support/DataTypes.h:58:3: error: "Must #define
__STDC_LIMIT_MACROS before #including Support/DataTypes.h"
# error "Must #define __STDC_LIMIT_MACROS before #including
Support/DataTypes.h"
  ^
/usr/include/llvm/Support/DataTypes.h:62:3: error: "Must #define
__STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
# error "Must #define __STDC_CONSTANT_MACROS before " \
  ^
2 errors generated.

The explanation in DataTypes.h:
"Note that this header's correct operation depends on __STDC_LIMIT_MACROS being
defined.  We would define it here, but in order to prevent Bad Things happening
when system headers or C++ STL headers include stdint.h before we define it
here, we define it on the g++ command line (in Makefile.rules)."

I don't think this applies when compiling in C11 mode, e.g. when including this
header from third-party code.

Suggested fix: Surround the error message with "#if __STDC_VERSION__ < 201112L"
or something to that effect.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>