❦ 29 mars 2016 16:52 +0200, Willy Tarreau <w...@1wt.eu> : > l = calloc(1, sizeof(*l)); [...] >> I can propose a (large) patch to remove all those casts (using a >> semantic patch to not miss anything). Here is a preview (for master, >> only src/): >> >> https://gist.github.com/dc61d8b035545dc24efd >> >> After this patch, this leaves 52 casts to be examined for alignment (git >> grep '= (struct.*\*)', not rocket science). Of course, no need to really >> apply the patch to examine those, but in the future, this may be easier >> without those casts. > > I'm fine with a huge cleanup patch at once. We should just synchronize to > limit the rejects. I currently have a few pending patches from Thierry > and Baptiste I guess.
OK, so, I'll propose a patch for this, including the sizeof() change (or another patch for the sizeof() change?). For the record, I don't do this manually, I use a semantic patch like this: @@ type T; @@ - (T\( \|\)*) (\(lua_touserdata\|malloc\|calloc\)(...)) So, I can rebase the patch as long as it's needed. >> 3. correct TLV handling in connection.c > > I just checked and the TLV is 32-bit aligned so I guess we don't need > any change there. OK, smart design. ;-) -- A man was reading The Canterbury Tales one Saturday morning, when his wife asked "What have you got there?" Replied he, "Just my cup and Chaucer."