Boost logo

Boost :

Subject: Re: [boost] [scope_exit] trunk tests fail on sun compiler
From: Stefan Teleman (stefan.teleman_at_[hidden])
Date: 2012-04-04 23:12:55


On Wed, Apr 4, 2012 at 22:28, lcaminiti <lorcaminiti_at_[hidden]> wrote:
>
> Stefan Teleman-2 wrote
>>
>> [steleman_at_darthvader][~/tmp][04/04/2012 19:00:53][1104]>> cat ./typeof.cc
>> #include <iostream>
>>
>> int
>> main (int argc, char* argv[])
>> {
>>     typeof (typeof (char*)[4]) y0;
>>     typeof (int*) y1[4];
>>     char* y2[4];
>>     int* y3[4];
>>
>>     std::cerr << argv[0] << std::endl;
>>
>>     return 0;
>> }
>>
>> [steleman_at_darthvader][~/tmp][04/04/2012 19:01:00][1105]>>
>> /opt/oracle/solarisstudio12.3/bin/CC -m32 -g -xO3 -Qoption ccfe
>> -features=gcc typeof.cc -o typeofCC
>>
>
> Sun CC has __typeof__ since 5.9:
> http://developers.sun.com/sunstudio/support/CCcompare.html
>
> I'm not sure which one of your flags make CC use "typeof" instead of
> __typeof__ but I think we should use __typeof__ on Sun as indicated by the
> link above and as currently and correctly detected by Boost.Typeof (before
> Boost.Config changes __typeof__ to typeof).

-Qoption ccfe -features=gcc.

To build Boost with SunProCC you're going to have to pass several
-Qoption ccfe -features=<X> to the compiler anyway. Might as well bite
the bullet and pass them. :-) Otherwise, no dice, it won't build.

Also, the document page you are referring to shows an inconsistency
between the typeof operator implementations in SunProC vs. SunProCC:

http://developers.sun.com/solaris/articles/c_type.html

SunProC allows typeof (without underscores) by default, without any
special flags:

[steleman_at_darthvader][~/tmp][04/04/2012 23:04:00][1122]>>
/opt/oracle/solarisstudio12.3/bin/cc -m32 -g -xO3 typeof.c -o typeofC
[steleman_at_darthvader][~/tmp][04/04/2012 23:04:09][1123]>> ./typeofC
./typeofC
[steleman_at_darthvader][~/tmp][04/04/2012 23:04:13][1124]>> echo $status
0
[steleman_at_darthvader][~/tmp][04/04/2012 23:04:17][1125]>> cat ./typeof.c

#include <stdio.h>

int
main(int argc, char* argv[])
{
    typeof (typeof (char*)[4]) y0;
    typeof (int*) y1[4];
    char* y2[4];
    int* y3[4];

    (void) fprintf(stderr, "%s\n", argv[0]);

    return 0;
}

But, neither typeof nor __typeof__ are part of any Standard anyway.

--Stefan

-- 
Stefan Teleman
KDE e.V.
stefan.teleman_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk