[llvm-bugs] [Bug 27029] New: [ms] Unsupported Source-code Annotation Language

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 22 05:30:24 PDT 2016


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

            Bug ID: 27029
           Summary: [ms] Unsupported Source-code Annotation Language
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hrulikus at ya.ru
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

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==============================
>>> MSVC:
 compiles this code successfully


>>>clang:
$ 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

-- 
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/20160322/fe4f6231/attachment-0001.html>


More information about the llvm-bugs mailing list