classpath
[Top][All Lists]
Advanced

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

Re: Usage of "attribute"


From: Tom Tromey
Subject: Re: Usage of "attribute"
Date: 29 Oct 2004 09:52:32 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>>>> "Torsten" == Torsten Rupp <address@hidden> writes:

Torsten> Unfortunatelly this is not portable to some non-GNU compilers (as I
Torsten> know... at least I have one C-compiler for ARM which can not handle
Torsten> this). Can we use a macro for this? E. g.
Torsten> #ifdef __GNUC__
Torsten>    #define VARIABLE_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
Torsten> #else
Torsten>    #define VARIABLE_ATTRIBUTE_UNUSED
Torsten> #endif

gtkpeer.h does this:

#ifndef __GNUC__
#define __attribute__(x) /* nothing */
#endif

Just go ahead and add this to whatever other header needs it.

Torsten> Another idea would be some construct of the form
Torsten> if ((parameter)==(parameter));

IMO it is better to use attribute.  These little tricks have a way of
breaking as compilers change.

Tom




reply via email to

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