#if does not help to deal with different processors when only some of them have 
performance penalties.
The benefit of a warning is to question the developer about its code and 
possible way to fix it.
At least, he knows it code has the prerequisite to support misaligned memory of 
given types. 


-----Original Message-----
From: Tinycc-devel [mailto:[email protected]] On 
Behalf Of Vincent Lefevre
Sent: Sunday, June 23, 2019 12:42
To: [email protected]
Subject: Re: [Tinycc-devel] undefined sanitizer

On 2019-06-23 06:51:04 +0200, Christian Jullien wrote:
> > Yes, it's implementation defined, but I assume that -fsanitize=undefined 
> > warns only when the implementation has decided that this was incorrectly 
> > aligned.
> 
> It's nice to have this warning even if implementation supports incorrect 
> alignment. Suppose I provide a portable C library which will be compiled with 
> on different architectures. As developer, I want what has a high risk to hang 
> on machines I'm not even aware of.

The code may have #ifdef's or similar code to enable misaligned
accesses only when supported. In such a case, a warning would not
be useful, unless explicitly requested.

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to