https://bugs.llvm.org/show_bug.cgi?id=52533

            Bug ID: 52533
           Summary: __STDC_IEC_559__ depends on #include <stdio.h>:
                    confused
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

Note: this may not be a bug. However, it is expected that __STDC_IEC_559__ does
not depend on any #include and stays constant during the translation.

This code:
#include FNAME
#if __STDC_IEC_559__ == 1
#pragma message "__STDC_IEC_559__ is 1"
#else
#pragma message "__STDC_IEC_559__ is not 1"
#endif

compiled with:
$ clang t0.c -std=c11 -pedantic -Wall -Wextra -DFNAME="<stdio.h>"

leads to:
t0.c:3:9: warning: __STDC_IEC_559__ is 1 [-W#pragma-messages]

while compiled with:
$ clang t0.c -std=c11 -pedantic -Wall -Wextra -DFNAME="<float.h>"

leads to:
t0.c:3:9: warning: __STDC_IEC_559__ is not 1 [-W#pragma-messages]

Here we see that the value of __STDC_IEC_559__ depends on #include. Which is
confusing. Please explain / investigate.

Version: clang 13.0.0 on Linux on x86_64

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to