[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gcc 3.2 warnings ?

From: Nicola Pero
Subject: Re: gcc 3.2 warnings ?
Date: Mon, 2 Sep 2002 10:39:19 +0100 (BST)

> > since I upgraded to gcc 3.2 I have to compilation problems:
> > 
> > a) warning: pasting "[" and "[" does not give a valid preprocessing token
> > - this is some macro, I think I get this with NSAssert and THROW

Just removing the ### should work - I did it yesterday and
libFoundation-090 compiled fine with 3.3.

> > b) casting Objective-C protocols doesn't seem to work. Eg if I do
> >    [(id)stream doIt];
> > the compiler complains that the NGStream protocol doesn't support doIt 
> > (which is correct, but I did cast !)

This is definitely a bug in the compiler - I think the C cast code has
been modified in the compiler without taking into account ObjC.  I can see
that the compiler is not doing the cast; at a quick glance at the code, I
think it's probably trying to optimize away unneeded casts, and because
'id' and 'id<NGStream>' look the same to C (they are just the same
pointer, if you forget about the protocol attached to the second one), the
cast is optimized away.

I'll try to have it fixed before GCC 3.3 is out.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]