This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFI]: getting objc to grok attributes ??
- From: Nicola Pero <nicola at brainstorm dot co dot uk>
- To: Sheldon Gill <sheldon at iinet dot net dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 24 Jun 2002 10:49:37 +0100 (BST)
- Subject: Re: [RFI]: getting objc to grok attributes ??
Hi Sheldon,
thanks - I'm forwarding your suggestion to the GCC mailing list.
On Mon, 24 Jun 2002, Sheldon Gill wrote:
> > Said that, I wouldn't say yet that the consensus is to remove the warnings
> >:-) it's my opinion and of a few of my gnustep friends - we probably want
> > to get more feedback from other users (Stan might have access to quite
> > another large pool of experienced users in the form of the Apple ObjC
> > developers) to get a better understanding (maybe someone else can suggest
> > a great, different - or improved -, solution).
>
> I think that being able to mark specific arguments to methods as not being
> used for _that_ implementation is a good thing. Whether an argument is used
> or not in a particular method implementation is really a method internal
> issue and not one which should be exposed in the interface.
>
> Personally, I find I do this a lot in developing code which will I intend to
> re-use elsewhere. I'll design the interface to be as generic as possible and
> may only implement very specific functionality initially. I'm sure you do
> too and understand where I'm coming from.
>
> Anyway, as I was saying I think that being able to signal to the compiler
> that the unused argument is known about is definitely a good idea. My
> suggestion as to how to accomplish this isn't in keeping with the rest of
> gcc but works well for objc (and could easily work for the others):
>
> - (void) addConnection: (NSConnection*)aConnection
> toRunLoop: (NSRunLoop*)aLoop
> forMode: (NSString*)aMode
> {
> #pragma unused(aMode)
> }
>
> This wouldn't complicate the parser at all and wouldn't introduce artefacts
> for semi-parsers or scanners. It wouldn't upset other compilers. All it'd do
> is turn off the compiler warning for this function. Later on, if the
> functionality associated with the aMode parameter is implemented it'd only
> require a change right there in the method implementation.
>
> Is this a reasonable solution?
>
>
> Regards,
> Sheldon
>