Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 18 Dec 2012 13:31:49 +0100
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: spandsp build, lrint/sqrt/pow issue

* Szabolcs Nagy <nsz@...t70.net> [2012-12-18 12:45:09 +0100]:
> * ojab <ojab@...b.ru> [2012-12-18 10:07:09 +0400]:
> > LLVM guys has closed http://llvm.org/bugs/show_bug.cgi?id=14618 as invalid.
> > Type expression, that mentioned above, compiles without errors on
> > both gcc and clang, so looks like an error anywhere else. Testcase
> > was:
> > int main() {
> >     __typeof__(0 ? (int*)0 : (void*)1) x;
> > }
> 
> they should not close the bug if they don't understand it..
> 
> the bug has nothing to do with integer constant expressions
> 
> the more i look at it the more convinced i am that this
> is a big fat clang bug
> 

i take this back

i found an old clang-2.7 around and i could
reproduce the error with it so the problem is

__typeof__(*(0 ? (double*)0 : 0 ? (void*)0 : (void*)0)) x;

we expect this to be double, but clang evaluates
it as void

which means clang does not treat 0?(void*)0:(void*)0
as a null pointer constant

which is most likely correct so then this is a gcc bug

i'd let them both know about the issue meanwhile
i'll try to think about a workaround..

(i'd also argue that this is a bug in the standard
but then the definition of integer constant expression
should be changed as well, now it seems to be that
0?(void*)0:(void*)0 is not even a 'constant expressoin'
which means it cannot be used in initializers, which
is absurd)

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.