<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - FLT16_MAX is defined but _Float16 is not supported: confused"
   href="https://bugs.llvm.org/show_bug.cgi?id=52532">52532</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FLT16_MAX is defined but _Float16 is not supported: confused
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>C
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>pavel.morozkin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Notes:
1. This may not be a bug. Just want to draw attention to it.
2. This may not be a bug in clang itself, but rather in the system / C standard
library headers. Feel free to move it.

This code:
#define __STDC_WANT_IEC_60559_TYPES_EXT__
#include <float.h>
#ifdef FLT16_MAX
_Float16 f16;
#endif

compiled with [1]:
clang -std=c11 -Wall -Wextra

leads to:
t0.c:4:1: error: _Float16 is not supported on this target

which is confusing because FLT16_MAX is defined.

Per IEC 60559 interchange and extended types [2] it seems that if FLT16_MAX is
defined, then _Float16 is supported. Otherwise, how to correctly determine at
compile time that _Float16 is supported?

Thanks for the attention.

[1] Version: clang trunk on linux on x86_64
[2] <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2601.pdf">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2601.pdf</a></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>