Re: question about spinlocks on UP

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Sun, 24 Aug 1986 23:50:12 +0100


> The problem are static spinlock variables. If you don't reference them,
> and don't #ifdef them out then gcc will always spew out an ugly warning.

You can use __attribute__ ((unused)) to suppress the warning, this
has worked for a long time.

You can't stick the attribute on the typedef for spinlock_t directly,
it is ignored, but what you can do in <asm/spinlock.h> is:

typedef struct { } __spinlock_t;
#define spinlock_t __spinlock_t __attribute__ ((__unused__))

Then `static spinlock_t lock' doesn't issue a warning if it's not used.
Presumably the above #define would only be done for UP.

-- Jamie "compiler tricks 'R' us"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html