On 19 March 2017 at 00:21, Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote: > On Tue, Mar 14, 2017 at 04:07:40PM +0000, Dibyendu Majumdar wrote: >> LLVM complains when the operands of a select are not the same type. I >> think it is okay to cast one of the operands to the type of the other >> - on the basis that subsequent operations will cast things anyway. > > Submit a test case, please. > typedef union GCObject GCObject; typedef union { GCObject *gc; void *p; int b; } Value; typedef struct lua_TValue { Value value; int tt; } TValue; typedef struct CClosure { GCObject *next; TValue upvalue[1]; } CClosure; typedef struct LClosure { GCObject *next; GCObject *gclist; } LClosure; typedef union Closure { CClosure c; LClosure l; } Closure; static TValue luaO_nilobject_; TValue *select(Closure *closure, int op) { return op == 1 ? &closure->c.upvalue[0] : (TValue *) &luaO_nilobject_; } -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html