> Leopard$ g++-4.2 -arch x86_64 -g -O2 -march=nocona -fasm-blocks  
> hello.cpp
> In file included from hello.cpp:2:
> hello.hpp: In function 'int atomic_exchange_and_add(int*, int)':
> hello.hpp:15: error: expected `)' before ':' token
>

It's a bug in Apple GCC, as near as I can tell.

It might be fixed in the most recent Apple patches to GCC 4.2, which  
have been posted at:
http://www.opensource.apple.com/darwinsource/DevToolsMar2008/ 
gcc_42-5553/

I cobbled up a MacPorts port file that plops these patches on top of  
a "mainline" GCC 4.2.1 and builds C,C++, and Objective-C  
compilers.It's a horrid hack, but it works, and you don't have to  
have an ADC membership to get it, and it works on Tiger, as well as  
Leopard.

(I say "might" because I'm not sure.. I'll have to check, as I'm not  
at my work machine right now.)

The most recent versions of Apple-GCC-4.2.1 -- released with their  
iPhone developer kit -- fix this problem (at least on Intel)... note  
that the iPhone is an ARM platform (not Intel or PowerPC), but as a  
side-effect of updating the compiler for iPhone platform support,  
they fixed the inline-assembly.

Now I'm after them to un-break gfortran after applying their  
Objective-C-2.0 patches...

I'm not sure this helps, but I suggest anyone interested in GCC 4.2  
on Mac to sign up for their (free) Apple ADC and (free) Apple iPhone  
SDK memberships, and download the iPhone SDK.

Best of luck!

- boyd

Boyd Waters
Scientific Programmer
National Radio Astronomy Observatory
(via my .Mac account on my stripped-down test machine...)




	[[alternative HTML version deleted]]

