diff -ruN ecos_web_cvs/ecos/packages/infra/current/ChangeLog ecos/ecos/packages/infra/current/ChangeLog --- ecos_web_cvs/ecos/packages/infra/current/ChangeLog 2009-02-14 04:15:14.000000000 +0100 +++ ecos/ecos/packages/infra/current/ChangeLog 2009-10-06 10:47:20.906250000 +0200 @@ -1,3 +1,9 @@ +2009-10-06 Uwe Kindler + + * include/cyg_type.h: Changed definition of macro + CYG_REFERENCE_OBJECT according to proposal of Bart Veer on + ecos-discuss mailing list. + 2009-02-14 Jonathan Larmour * tests/cxxsupp.cxx (cyg_start): Only test 'new' with ARM tools after diff -ruN ecos_web_cvs/ecos/packages/infra/current/include/cyg_type.h ecos/ecos/packages/infra/current/include/cyg_type.h --- ecos_web_cvs/ecos/packages/infra/current/include/cyg_type.h 2009-02-04 17:59:41.000000000 +0100 +++ ecos/ecos/packages/infra/current/include/cyg_type.h 2009-10-06 10:34:50.406250000 +0200 @@ -196,15 +196,16 @@ CYG_MACRO_END -// ------------------------------------------------------------------------- -// Reference a symbol without explicitly making use of it. Ensures that -// the object containing the symbol will be included when linking. - -#define CYG_REFERENCE_OBJECT(__object__) \ - CYG_MACRO_START \ - static void *__cygvar_discard_me__ __attribute__ ((unused)) = \ - &(__object__); \ - CYG_MACRO_END +//---------------------------------------------------------------------------- +// The unused attribute stops the compiler warning about the variable +// not being used. +// The used attribute prevents the compiler from optimizing it away. + +#define CYG_REFERENCE_OBJECT(__object__) \ + CYG_MACRO_START \ + static const void* __cygvar_discard_me__ \ + __attribute__ ((unused, used)) = (const void*)&(__object__); \ + CYG_MACRO_END // ------------------------------------------------------------------------- // Define basic types for using integers in memory and structures;