# HG changeset patch # User grante # Date 1331059496 0 # Node ID c1987d8f692abe76f3acf57ad6d5fa0477e97657 # Parent 44b61e2c19f7b69b2ba83222da85fa494efea6ce Add CYGBLD_ATTRIB_UNUSED. Part of [ Bugzilla 100504 ] diff --git a/packages/infra/current/ChangeLog b/packages/infra/current/ChangeLog --- a/packages/infra/current/ChangeLog +++ b/packages/infra/current/ChangeLog @@ -1,4 +1,10 @@ 2012-03-06 Grant Edwards + + * include/cyg_type.h: Add CYGBLD_ATTRIB_UNUSED macro to be used to + eliminate compiler warnings about unused or set-but-not-referenced + varibles. Part of: [ Bugzilla 1001504 ] + +2012-03-06 * src/diag.cxx: Fix compiler warnings about variables that are set but never read. [ Bugzilla 1001503 ] diff --git a/packages/infra/current/include/cyg_type.h b/packages/infra/current/include/cyg_type.h --- a/packages/infra/current/include/cyg_type.h +++ b/packages/infra/current/include/cyg_type.h @@ -452,6 +452,11 @@ typedef cyg_haladdrword CYG_ADDRWORD; # define CYGBLD_ATTRIB_STRFTIME_FORMAT(__format__, __args__) \ __attribute__((format (strftime, __format__, __args__))) +// Tell compiler not to warn us about an unused variable -- generally +// because it will be used when sources are build under certain +// circumstances (e.g. with debugging or asserts enabled. +# define CYGBLD_ATTRIB_UNUSED __attribute__((unused)) + // Tell the compiler not to throw away a variable or function. Only known // available on 3.3.2 or above. Old version's didn't throw them away, // but using the unused attribute should stop warnings. @@ -464,6 +469,8 @@ typedef cyg_haladdrword CYG_ADDRWORD; # endif #else // non-GNU +# define CYGBLD_ATTRIB_UNUSED /* nothing */ + # define CYGBLD_ATTRIB_CONSTRUCTOR # define CYGBLD_ATTRIB_NORET