[LLVMbugs] [Bug 3386] New: clang rejects a sensible application of __alignof__
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Sat Jan 24 03:22:27 PST 2009
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: unassignedclangbugs at nondot.org
ReportedBy: bagnara at cs.unipr.it
CC: llvmbugs at cs.uiuc.edu, bolzoni at cs.unipr.it
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.
More information about the llvm-bugs
mailing list