https://llvm.org/bugs/show_bug.cgi?id=27645
Bug ID: 27645
Summary: Wrong "error: cannot jump from this indirect goto
statement to one of its possible targets"
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Source code:
----------------------------------------------------------------------
int main()
{
void *p = &&first;
goto *p;
first:;
int n = 1;
char a[n];
void *q = &&second;
goto *q;
second:;
}
----------------------------------------------------------------------
Results:
----------------------------------------------------------------------
$ clang -std=gnu11 test.c && ./a.out
test.c:4:3: error: cannot jump from this indirect goto statement to one of its
possible targets
goto *p;
^
test.c:14:2: note: possible target of indirect goto statement
second:;
^
test.c:9:8: note: jump bypasses initialization of variable length array
char a[n];
^
1 error generated.
----------------------------------------------------------------------
clang version: clang version 3.9.0 (trunk 268228)
The source code is safe and the clang error is wrong. OTOH my testcase is
artificial and maybe better analysis just doesn't worth the trouble.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs