Is the empty initializers bug fixed in gcc-3.0?

Niels Kristian Bech Jensen (nkbj@image.dk)
Sun, 22 Apr 2001 12:35:02 +0200 (CEST)


This piece of code from include/linux/spinlock.h (linux-2.4.3) works
around a compiler bug with empty initializers. Does anybody know if this
bug has been fixed in gcc-3.0?

/*
* Your basic spinlocks, allowing only a single CPU anywhere
*
* Most gcc versions have a nasty bug with empty initializers.
*/
#if (__GNUC__ > 2)
typedef struct { } spinlock_t;
#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
#else
typedef struct { int gcc_is_buggy; } spinlock_t;
#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
#endif

-- 
Niels Kristian Bech Jensen -- nkbj@image.dk -- http://www.image.dk/~nkbj/

----------->> Stop software piracy --- use free software! <<-----------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/