Richard Henderson <r...@twiddle.net> writes: >> diff --git a/osdep.h b/osdep.h >> index cb213e0..df89552 100644 >> --- a/osdep.h >> +++ b/osdep.h >> @@ -41,8 +41,9 @@ typedef signed int int_fast16_t; >> #endif >> >> /* Convert from a base type to a parent type, with compile time checking. >> */ >> -#ifdef __GNUC__ >> -#define DO_UPCAST(type, field, dev) ( __extension__ ( { \ >> +#if defined (__GNUC__) && \ >> + (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) >> +#define DO_UPCAST(type, field, dev) ( __extension__ ( { \ >> char __attribute__((unused)) offset_must_be_zero[ \ >> -offsetof(type, field)]; \ >> container_of(dev, type, field);})) > > Try moving the attribute to the end of the declaration, > i.e. just before the semi-colon.
The patch below doesn't make any difference. Søren diff --git a/osdep.h b/osdep.h index cb213e0..1a36c20 100644 --- a/osdep.h +++ b/osdep.h @@ -43,8 +43,8 @@ typedef signed int int_fast16_t; /* Convert from a base type to a parent type, with compile time checking. */ #ifdef __GNUC__ #define DO_UPCAST(type, field, dev) ( __extension__ ( { \ - char __attribute__((unused)) offset_must_be_zero[ \ - -offsetof(type, field)]; \ + char offset_must_be_zero[ \ + -offsetof(type, field)] __attribute__((unused)) ; \ container_of(dev, type, field);})) #else #define DO_UPCAST(type, field, dev) container_of(dev, type, field)