Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 17 Jul 2015 22:23:34 +0200
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: Re: Re: Left-shift of negative number

Hello Pascal,
you a probably right with your findings and so we should change the
code as I indicated. I think we just have to promote the one constant
and then all types are unsigned and of the right width.

But I should comment on this:

Am Freitag, den 17.07.2015, 19:55 +0000 schrieb Pascal Cuoq:
> I know that this is not well-known, so perhaps I should explain: ever since
> the late 1990s, C compilers have been taking advantage of undefined behavior
> in the C standard to introduce new optimizations.

No it is actually the other way around. The C standard voluntarily
leaves certain behavior undefined to have leeway for compiler and
library implementors to do what they (think they) have to do. So there
is a clear distinction what UB means for "user" code and for the
implementation.

musl (and other C libraries I suppose) heavily rely on specific
properties of compilers, that is basically all what the writing of a C
library for a specific platform is about.

So the argument to show that this is a bug can not be "that is UB",
but must be, as you did, there is this-and-that compiler for which
this behavior is different.

Jens


-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::




Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.