[PATCH] libdwfl: Fix wrong type to make gcc -fsanitize=undefined happy.

Roland McGrath roland at hack.frob.com
Thu Apr 23 17:05:44 UTC 2015


> Extra plus in front of 0? Why not just use sizeof(struct msgtable)?

Yeah, I guess that would be fine too.

> Something like can be done without unions:
> 
> #define msgstr (*(char (*)[sizeof msgtable])&msgtable)
> 
> AFACT it's well-defined C and permits to perform bound checking.

That's less clean than a union.


More information about the elfutils-devel mailing list