[cfe-dev] Fwd: CodeGen/statements.c: Don't understand test and its failure
John Thompson
john.thompson.jtsoftware at gmail.com
Thu Oct 15 09:05:25 PDT 2009
Sorry Chris, I meant to send this to the list.
---------- Forwarded message ----------
From: John Thompson <john.thompson.jtsoftware at gmail.com>
Date: Thu, Oct 15, 2009 at 8:59 AM
Subject: Re: [cfe-dev] CodeGen/statements.c: Don't understand test and its
failure
This is the GNU address of a label extension. Can you remove the 'static'
> (which will allow it to parse) and paste what clang-cc -ast-dump shows for
> that statement?
>
Thanks. Here it is:
CodeGen/statements.c:5:6: warning: integer constant is too large for its
type
case 111111111111111111111111111111111111111:
^
CodeGen/statements.c:5:6: warning: overflow converting case value to switch
condition type (11011968431394943431 to 18446744072755114439)
CodeGen/statements.c:11:15: warning: non-void function 'test2' should return
a value
int test2() { return; }
^
CodeGen/statements.c:12:16: warning: void function 'test3' should not return
a value
void test3() { return 4; }
^ ~
CodeGen/statements.c:24:17: warning: incompatible pointer to integer
conversion initializing 'void *', expected 'long'
static long y = &&baz;
^~~~~
CodeGen/statements.c:28:10: warning: incompatible integer to pointer
conversion passing 'long', expected 'void *'
goto *y;
^~
CodeGen/statements.c:30:8: warning: incompatible integer to pointer
conversion passing 'long', expected 'void *'
goto *x;
^~
CodeGen/statements.c:25:3: warning: expression result unused
&&bing;
^~~~~~
CodeGen/statements.c:26:3: warning: expression result unused
&&blong;
^~~~~~~
CodeGen/statements.c:34:31: warning: incompatible integer to pointer
conversion passing 'long long', expected 'void *'
int test5(long long b) { goto *b; }
^~
typedef char *__builtin_va_list;
void test1(int x)
int bar();
int test2()
void test3()
void test4()
int test5(long long b)
(CompoundStmt 029AF2D8 <CodeGen/statements.c:3:19, line:8:1>
(SwitchStmt 029AEC98 <line:4:1, line:7:1>
(DeclRefExpr 029B0570 <line:4:9> 'int' ParmVar='x' 029B0508)
(CompoundStmt 029AF120 <col:12, line:7:1>
(CaseStmt 029AEE48 <line:5:1, line:6:5>
(CallExpr 029AF0A8 <col:1, col:5> 'int'
(ImplicitCastExpr 029AF060 <col:1> 'int (*)()'
<FunctionToPointerDecay>
(DeclRefExpr 029AEFD0 <col:1> 'int ()' FunctionDecl='bar'
029AEF40)))
(ImplicitCastExpr 029AF1E8 <line:5:6> 'int' <Unknown>
(IntegerLiteral 029AEDF0 <col:6> 'unsigned long long'
11011968431394943431))
<<<NULL>>>))))
(CompoundStmt 029AF3F0 <CodeGen/statements.c:11:13, col:23>
(ReturnStmt 029AF3B0 <col:15>))
(CompoundStmt 029AF638 <CodeGen/statements.c:12:14, col:26>
(ReturnStmt 029AF5F8 <col:16, col:23>
(IntegerLiteral 029AF5A0 <col:23> 'int' 4)))
(CompoundStmt 029AF740 <CodeGen/statements.c:15:14, line:31:1>
(LabelStmt 029B7068 <line:16:1, line:20:2> 'bar'
(LabelStmt 029B7028 <line:17:1, line:20:2> 'baz'
(LabelStmt 029AF7C8 <line:18:1, line:20:2> 'blong'
(LabelStmt 029AF788 <line:19:1, line:20:2> 'bing'
(NullStmt 029AF230 <col:2>)))))
(DeclStmt 029B7238 <line:23:1, col:23>
029B70A8 "long x =
(ImplicitCastExpr 029B71F0 <col:10, col:20> 'long' <Unknown>
(BinaryOperator 029B71A0 <col:10, col:20> 'int' '-'
(AddrLabelExpr 029B7110 <col:10, col:12> 'void *' bar 029B7068)
(AddrLabelExpr 029B7158 <col:18, col:20> 'void *' baz 029B7028)))"
(DeclStmt 029B7370 <line:24:1, col:22>
029B7278 "static long y =
(ImplicitCastExpr 029B7328 <col:17, col:19> 'long' <Unknown>
(AddrLabelExpr 029B72E0 <col:17, col:19> 'void *' baz 029B7028))"
(AddrLabelExpr 029B73B0 <line:25:3, col:5> 'void *' bing 029AF788)
(AddrLabelExpr 029B73F8 <line:26:3, col:5> 'void *' blong 029AF7C8)
(IfStmt 029B7558 <line:27:3, line:28:11>
(DeclRefExpr 029B7440 <line:27:7> 'long' Var='y' 029B7278)
(IndirectGotoStmt 029B7518 <line:28:5, col:11>
(ImplicitCastExpr 029B74D0 <col:11> 'void *' <Unknown>
(DeclRefExpr 029B7488 <col:11> 'long' Var='y' 029B7278)))
<<<NULL>>>)
(IndirectGotoStmt 029B7630 <line:30:3, col:9>
(ImplicitCastExpr 029B75E8 <col:9> 'void *' <Unknown>
(DeclRefExpr 029B75A0 <col:9> 'long' Var='x' 029B70A8))))
(CompoundStmt 029AE428 <CodeGen/statements.c:34:24, col:35>
(IndirectGotoStmt 029B7918 <col:26, col:32>
(ImplicitCastExpr 029B78D0 <col:32> 'void *' <Unknown>
(DeclRefExpr 029B7888 <col:32> 'long long' ParmVar='b' 029B7708))))
10 diagnostics generated.
--
John Thompson
John.Thompson.JTSoftware at gmail.com
--
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091015/88699dff/attachment.html>
More information about the cfe-dev
mailing list