changeset 3100:c1987d8f692a

Add CYGBLD_ATTRIB_UNUSED. Part of [ Bugzilla 100504 ]
author grante
date Tue, 06 Mar 2012 18:44:56 +0000
parents 44b61e2c19f7
children e8b153151417
files packages/infra/current/ChangeLog packages/infra/current/include/cyg_type.h
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/infra/current/ChangeLog
+++ b/packages/infra/current/ChangeLog
@@ -1,4 +1,10 @@
 2012-03-06  Grant Edwards  <grant.b.edwards@gmail.com>
+
+	* 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 ]
--- 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