<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 - Clang on Windows: MSVC compatibility: values of __STDC__ do not match between Clang and MSVC"
href="https://bugs.llvm.org/show_bug.cgi?id=52144">52144</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang on Windows: MSVC compatibility: values of __STDC__ do not match between Clang and MSVC
</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>Windows NT
</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>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</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>