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 12:45:09 +0100
From: Szabolcs Nagy <>
Subject: Re: spandsp build, lrint/sqrt/pow issue

* ojab <> [2012-12-18 10:07:09 +0400]:
> LLVM guys has closed 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

but you should cut down the test case to a smaller one,
i cannot do that without clang, the (void*)1 was just
my best guess

i assume the fp and float checks work in clang
so a smaller test case could be:

// should be the same as __typeof__(*(double*)0) x;
0 ? (__typeof__(0 ? (double *)0 : (void *)0))0 :
0 ? (__typeof__(0 ? (double _Complex *)0 : (void *)1))0 :
    (__typeof__(0 ? (__typeof__(1) *)0 : (void *)1))0 )) x;

if this fails like the original one then you can cut down
even more by checking the individual branches:

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

// double _Complex* y
__typeof__(0 ? (double _Complex *)0 : (void *)1) y;

// void* z
__typeof__(0 ? (__typeof__(1) *)0 : (void *)1) z;


if the above works then the error is in the
__IS_FP or FLT or FLTCX macros

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.