[rtems commit] mqueueopen.c: Switch to using RTEMS_COMPILER_UNUSED_ATTRIBUTE

Joel Sherrill joel at rtems.org
Sun Sep 22 14:37:20 UTC 2013


Module:    rtems
Branch:    master
Commit:    49fb4dcb52f4b7a124819f287e4e075d486dd9e1
Changeset: http://git.rtems.org/rtems/commit/?id=49fb4dcb52f4b7a124819f287e4e075d486dd9e1

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Sun Sep 22 09:41:13 2013 -0500

mqueueopen.c: Switch to using RTEMS_COMPILER_UNUSED_ATTRIBUTE

---

 cpukit/posix/src/mqueueopen.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/cpukit/posix/src/mqueueopen.c b/cpukit/posix/src/mqueueopen.c
index a4bd28d..f5132ac 100644
--- a/cpukit/posix/src/mqueueopen.c
+++ b/cpukit/posix/src/mqueueopen.c
@@ -47,15 +47,6 @@
 /*
  *  15.2.2 Open a Message Queue, P1003.1b-1993, p. 272
  */
-
-/*
- * mode is set but never used. GCC gives a warning for this
- * and we need to tell GCC not to complain. But we have to
- * have it because we have to work through the variable
- * arguments to get to attr.
- */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
 mqd_t mq_open(
   const char *name,
   int         oflag,
@@ -64,8 +55,15 @@ mqd_t mq_open(
   /* struct mq_attr  attr */
 )
 {
+  /*
+   * mode is set but never used. GCC gives a warning for this
+   * and we need to tell GCC not to complain. But we have to
+   * have it because we have to work through the variable
+   * arguments to get to attr.
+   */
+  mode_t                          mode RTEMS_COMPILER_UNUSED_ATTRIBUTE;
+
   va_list                         arg;
-  mode_t                          mode;
   struct mq_attr                 *attr = NULL;
   int                             status;
   Objects_Id                      the_mq_id;
@@ -169,4 +167,3 @@ mqd_t mq_open(
 
   return (mqd_t) the_mq_fd->Object.id;
 }
-#pragma GCC diagnostic pop




More information about the vc mailing list