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

            Bug ID: 52144
           Summary: Clang on Windows: MSVC compatibility: values of
                    __STDC__ do not match between Clang and MSVC
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            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]

Sample code (t980.c):
#include <stdio.h>

int main()
{
#ifdef __STDC__
        printf("__STDC__ is defined to %d\n", __STDC__);
#else
        printf("__STDC__ is not defined\n");
#endif
        return 0;
}

Invocations:
$ cl t980.c /std:c11 /Za && ./t980.exe
__STDC__ is defined to 1

$ clang t980.c --std=c11 -pedantic -Wall -Wextra && ./a.exe
__STDC__ is not defined

Here we see that values of __STDC__ do not match between Clang and MSVC. I.e.
there is no MSVC compatibility w.r.t. __STDC__. Why? Unexpected.

Tool versions:
$ cl
Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30133 for x64

$ clang --version
clang version 12.0.0
Target: x86_64-pc-windows-msvc

-- 
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