This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]