diff --git a/ChangeLog b/ChangeLog index aeec793a4a..c7fafef79f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7076,4 +7076,6 @@ * configs/sama5d3x-ek: Change all configuration names to board- specific names so that this are no name collisions with other boards that have similar configuration variables (2013-3-30). - + * configs/nuttx/compiler.h: Add macro UNUSED() that can be used + to eliminate warnings about variables that are set to values + that are not used (2014-3-30). diff --git a/drivers/mtd/ramtron.c b/drivers/mtd/ramtron.c index 54fd3d078c..7a7439dce0 100644 --- a/drivers/mtd/ramtron.c +++ b/drivers/mtd/ramtron.c @@ -352,8 +352,8 @@ static inline int ramtron_readid(struct ramtron_dev_s *priv) if (priv->part->name) { - (void)manufacturer; /* Eliminate warnings when debug is off */ - (void)memory; /* Eliminate warnings when debug is off */ + UNUSED(manufacturer); /* Eliminate warnings when debug is off */ + UNUSED(memory); /* Eliminate warnings when debug is off */ fvdbg("RAMTRON %s of size %d bytes (mf:%02x mem:%02x cap:%02x part:%02x)\n", priv->part->name, priv->part->size, manufacturer, memory, capacity, part); diff --git a/drivers/usbdev/usbmsc_scsi.c b/drivers/usbdev/usbmsc_scsi.c index 2da4c5df86..c97f38881b 100644 --- a/drivers/usbdev/usbmsc_scsi.c +++ b/drivers/usbdev/usbmsc_scsi.c @@ -391,6 +391,7 @@ static void usbmsc_scsi_wait(FAR struct usbmsc_dev_s *priv) { ret = sem_wait(&priv->thwaitsem); DEBUGASSERT(ret == OK || errno == EINTR); + UNUSED(ret); /* Eliminate warnings when debug is off */ } while (priv->thwaiting); diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 1e6acd6ff0..8ed7e4ac57 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -58,6 +58,10 @@ # define CONFIG_HAVE_FUNCTIONNAME 1 /* Has __FUNCTION__ */ # define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ +/* Indicate that a local variable is not used */ + +# define UNUSED(a) ((void)(a)) + /* Attributes * * GCC supports weak symbols which can be used to reduce code size because