[LLVMdev] [cfe-dev] ubsan - active member check for unions
joerg at britannica.bec.de
Sat Dec 20 02:13:18 PST 2014
On Fri, Dec 19, 2014 at 06:59:48PM -0800, Richard Smith wrote:
> On Thu, Dec 18, 2014 at 11:05 PM, Yury Gribov <y.gribov at samsung.com> wrote:
> > Anyway, the pattern is so widespread that IMHO most maintainers will find
> > such errors useless.
> Well, given that this is the bug that the sanitizer is built to detect,
> such maintainers should not turn it on.
I agree with Yury that there are a few cases where it is the standard
approach and flagging it as error doesn't make sense. Question is
whether we can enumerate those cases and white list them. I know unions
are used in mathematical code for accesing floats as int and vice versa,
not sure about any thing else.
More information about the llvm-dev