On Wed, Feb 3, 2016 at 5:15 PM, Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> wrote: > Well with "cputime_t *" you got the pointer directly, by its own declaration; > with "&utime" you really _create_ one with the "&"/"addressof" operator. > > The function "create_pointer()" is only called when evaluating an expression > using the addressof operator or when when an array of a function is degenerated > into a pointer. Yes, I take a closer look. My previous understanding of how the MOD_PTRINHERIT works was wrong. Now I see the pointer is created differently. In the parsing stage, it is created by the "pointer" function. In the evaluation stage it is created by the "create_pointer" function. The "pointer" function has no treatment for MOD_PTRINHERIT at all. Ideally it would be nice to unify the pointer create some how. It is easier to have inconsistent modifier other than MOD_NOCAST. As a simply fix, your patch is fine. Applied. > > They _have_ the same type if we limit ourselves to the pure C type system, > but they differ once we look also at the sparse & gcc extension to the > type system, like the nocast attribute here. > > Now, whether they should be the same or not is a question of defining the > semantic of the addressof operator on sparse's type extension. I think sparse should treat them with same semantic. It does not make sense if they are not the same. Thanks. Chris -- 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