[cfe-dev] -fcatch-undefined-behavior false positive with readdir()?
pageexec at freemail.hu
Thu Sep 27 03:35:24 PDT 2012
On 26 Sep 2012 at 23:05, Richard Smith wrote:
> $ ./a.out
> dirent.cpp:4:19: fatal error: member access within misaligned address
> 0x7ffff752f787 for type 'struct dirent' requiring 8 byte alignment
> zsh: illegal hardware instruction (core dumped) ./a.out
> ... coming soon to a -fcatch-undefined-behavior near you. Snippet,
> backtrace, etc. to follow.
how is this reporting emitted exactly? in particular, will it be usable
from a kernel context? i've been trying to enable -fcatch-undefined-behavior
for linux for some time now and it caught interesting bugs but with the
addition of alignment checking it doesn't even get past self-decompression ;).
obviously any reporting at that point is not exactly trivial and were it
not for qemu, it'd be painful to debug... so what i'm trying to say is
that verbose reporting is nice but a mechanism to selectively disable UB
checking subfeatures would also be useful.
More information about the cfe-dev