[Top][All Lists]

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

Re: gcc 3.2 warnings ?

From: Helge Hess
Subject: Re: gcc 3.2 warnings ?
Date: Mon, 02 Sep 2002 13:18:48 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020722

Nicola Pero wrote:
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.

What exactly do you mean, I grepped for ### but didn't found anything. Do you say I should replace:
  #define NSAssert1(args...)    NSAssert(##args)
  #define NSAssert1(args...)    NSAssert(args)

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.

Excellent. I think this bug is also in MacOSX gcc 3.1.


reply via email to

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