[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] undefined sanitizer

From: Pascal Cuoq
Subject: Re: [Tinycc-devel] undefined sanitizer
Date: Sun, 23 Jun 2019 08:53:33 +0000

On 22 Jun 2019, at 22:29, Vincent Lefevre <address@hidden> wrote:

On 2019-06-22 20:59:57 +0200, Michael Matz wrote:

Indeed.  The thing is that such "mis"-alignment isn't generically undefined
behaviour (and hence shouldn't even be part of -fsanitize=undefined).  It's
implementation defined what it means for a pointer to an object type to be
correctly aligned (e.g. one where the natural alignment of all types is 1 is
fully conforming).  Accessing something via an incorrectly aligned pointer
is undefined, but what incorrectly aligned means is implementation defined.

Yes, it's implementation defined, but I assume that -fsanitize=undefined
warns only when the implementation has decided that this was incorrectly

Probably everyone has already seen this blog post about GCC generating code that crashes if pointers to uint32_t are not aligned to 4, but I will post the URL just in case:


reply via email to

[Prev in Thread] Current Thread [Next in Thread]