[LLVMbugs] [Bug 5767] New: Cannot parse valid C-gnu89 code (array decay problem?)
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Fri Dec 11 23:38:17 PST 2009
http://llvm.org/bugs/show_bug.cgi?id=5767
Summary: Cannot parse valid C-gnu89 code (array decay problem?)
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
$ cat bug.c
struct hek {
char hek_key[1];
};
extern void foo(char* p);
extern struct hek* zoo();
void bar() {
foo(({
({
struct hek *p;
p = zoo();
p;
})->hek_key;
}));
}
$ gcc -std=gnu89 -c bug.c
$ icc -std=gnu89 -c bug.c
$ clang -c -std=gnu89 bug.c
bug.c:10:7: error: incompatible type passing 'char [1]', expected 'char *'
foo(({
^~
1 diagnostic generated.
$
--
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