Boost logo

Boost :

Subject: Re: [boost] [scope_exit] trunk tests fail on sun compiler
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-04-04 22:28:44


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).

To recap, what I've seen is:
Boost.Typeof correctly detects that by `#define BOOST_TYPEOF_KEYWORD
__typeof__`. However, Boost.Config later `#define __typeof__ typeof` for all
non GCC compiler on Linux (I'm not sure why...). Therefore,
BOOST_TYEPOF_KEYWORD first expands to __typeof__ which in turns it expands
to typeof and CC fails because it doesn't know typeof (it expects __typeof__
instead as Boost.Typeof originally figured out).

Thanks.
--Lorenzo

--
View this message in context: http://boost.2283326.n4.nabble.com/boost-scope-exit-trunk-tests-fail-on-sun-compiler-tp4501546p4533807.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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