[llvm-bugs] [Bug 52532] New: FLT16_MAX is defined but _Float16 is not supported: confused

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 17 04:13:13 PST 2021


            Bug ID: 52532
           Summary: FLT16_MAX is defined but _Float16 is not supported:
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pavel.morozkin at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

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;

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] http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2601.pdf

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211117/9b939e65/attachment.html>

More information about the llvm-bugs mailing list