<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - [ms] Unsupported Source-code Annotation Language"
href="https://llvm.org/bugs/show_bug.cgi?id=27029">27029</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[ms] Unsupported Source-code Annotation Language
</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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>hrulikus@ya.ru
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>This report is about MSVC feature Source-code annotation language which
provides a set of annotations to describe how a function uses its parameters,
for example, the assumptions it makes about them and the guarantees it makes on
finishing. So clang does not support this feature
====================ENVIRONMENT==================
OS: Windows
Version: trunk
=================SMALL REPRODUCER======================
typedef unsigned short wchar_t;
[source_annotation_attribute( SA_All )]
struct AnnotesAttribute
{
wchar_t *Name;
wchar_t *p1;
};
typedef struct AnnotesAttribute SAL_annotes;
typedef struct _XSTATE_CONTEXT {
[SAL_annotes(Name="SAL_null", p1="__maybe")]
[SAL_annotes(Name="SAL_writableTo", p1="byteCount(L
ength)")] int A;
};
=================ERROR==============================
<span class="quote">>>> MSVC:</span >
compiles this code successfully
<span class="quote">>>>clang:</span >
$ clang-cl -c test.c
test.c:12:5: error: type name requires a specifier or qualifier
[SAL_annotes(Name="SAL_null", p1="__maybe")] [SAL_annotes(Name="SAL_...
^
test.c:12:6: error: unexpected type name 'SAL_annotes': expected expression
[SAL_annotes(Name="SAL_null", p1="__maybe")] [SAL_annotes(Name="SAL_...
^
test.c:12:18: error: use of undeclared identifier 'Name'
[SAL_annotes(Name="SAL_null", p1="__maybe")] [SAL_annotes(Name="SAL_...
^
test.c:12:35: error: use of undeclared identifier 'p1'
[SAL_annotes(Name="SAL_null", p1="__maybe")] [SAL_annotes(Name="SAL_...
^
test.c:12:51: error: unexpected type name 'SAL_annotes': expected expression
[SAL_annotes(Name="SAL_null", p1="__maybe")] [SAL_annotes(Name="SAL_...
^
test.c:12:63: error: use of undeclared identifier 'Name'
[SAL_annotes(Name="SAL_null", p1="__maybe")] [SAL_annotes(Name="SAL_...
^
test.c:12:86: error: use of undeclared identifier 'p1'
...p1="__maybe")] [SAL_annotes(Name="SAL_writableTo",
p1="byteCount(Length)...
^
test.c:12:111: error: expected member name or ';' after declaration
specifiers
...[SAL_annotes(Name="SAL_writableTo", p1="byteCount(Length)")] int Area;
^
test.c:12:110: error: expected ';' at end of declaration list
...[SAL_annotes(Name="SAL_writableTo", p1="byteCount(Length)")] int Area;
^
;
==============================================
Egor Khrulev
Software Engineer
Intel Compiler Team</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>