https://bugs.llvm.org/show_bug.cgi?id=50614
Bug ID: 50614
Summary: __has_declspec_attribute falsely reports some attrs as
supported for MinGW and Cygwin targets
Product: clang
Version: 12.0
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: xtk...@gmail.com
CC: htmldevelo...@gmail.com, llvm-bugs@lists.llvm.org,
neeil...@live.com, richard-l...@metafoo.co.uk
Created attachment 24923
--> https://bugs.llvm.org/attachment.cgi?id=24923&action=edit
Repro
It is true that the warnings for this specific repro can be silenced by adding
the -fms-extensions option, but this option causes other problems in practice
(causing function redefinition errors) and so I think I cannot use it.
$ cat mingw-declspec.c
#if __has_declspec_attribute(noalias)
__declspec(noalias)
#else
#warning no declspec noalias
#endif
void foo(void *a, void *b);
struct
#if __has_declspec_attribute(align)
__declspec(align(8))
#else
#warning no declspec align
#endif
bar { int i, j; } baz;
$ clang --target=x86_64-w64-mingw32 -fdeclspec -c mingw-declspec.c
mingw-declspec.c:3:12: warning: unknown attribute 'noalias' ignored
[-Wunknown-attributes]
__declspec(noalias)
^~~~~~~
<built-in>:343:38: note: expanded from here
#define __declspec(a) __attribute__((a))
^
mingw-declspec.c:11:12: warning: unknown attribute 'align' ignored
[-Wunknown-attributes]
__declspec(align(8))
^~~~~~~~
<built-in>:343:38: note: expanded from here
#define __declspec(a) __attribute__((a))
^
2 warnings generated.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs