http://llvm.org/bugs/show_bug.cgi?id=3386
Summary: clang rejects a sensible application of __alignof__
Product: clang
Version: unspecified
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected]
This comes from linux-2.6.28.1:
$ cat /tmp/bug28.c
struct crypto_tfm {
int crt_flags;
void *__crt_ctx[];
};
inline unsigned int crypto_tfm_ctx_alignment(void)
{
struct crypto_tfm *tfm;
return __alignof__(tfm->__crt_ctx);
}
$ gcc -c -W -Wall /tmp/bug28.c
$ icc -c -Wall /tmp/bug28.c
/tmp/bug28.c(9): warning #1549: alignment-of operator applied to incomplete
type
return __alignof__(tfm->__crt_ctx);
^
$ clang /tmp/bug28.c
/tmp/bug28.c:9:16: error: invalid application of '__alignof' to an incomplete
type 'void *[]'
return __alignof__(tfm->__crt_ctx);
^ ~~~~~~~~~~~~~~~~
1 diagnostic generated.
$
(I miss the point of the warning given by the Intel C compiler, by the way.)
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs