]> Savannah Git Hosting - gnulib.git/commitdiff
rename: mark a label as potentially unused
authorBen Walton <bdwalton@gmail.com>
Mon, 2 Jun 2014 18:50:41 +0000 (19:50 +0100)
committerPádraig Brady <P@draigBrady.com>
Mon, 2 Jun 2014 18:57:40 +0000 (19:57 +0100)
* lib/rename.c (rpl_rename): Avoid compiler warnings seen on Solaris,
by marking the out label as potentially unused.
* m4/gnulib-common.m4: Mention the need for the trailing ; for C++.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
lib/rename.c
m4/gnulib-common.m4

index 2116028217178b2160010ba162fcea8d7fc54507..b99b0046ea2c0f48c0eee39eed3586f3e2315c7a 100644 (file)
@@ -462,7 +462,9 @@ rpl_rename (char const *src, char const *dst)
 
   ret_val = rename (src_temp, dst_temp);
   rename_errno = errno;
- out:
+
+ out: _GL_UNUSED_LABEL;
+
   if (src_temp != src)
     free (src_temp);
   if (dst_temp != dst)
index 1bb316bb157604c286e21e1f4c0590bc150618ed..35f6195204e8986361e9b35499b924dc8deaea78 100644 (file)
@@ -50,7 +50,8 @@ AC_DEFUN([gl_COMMON_BODY], [
 #define _UNUSED_PARAMETER_ _GL_UNUSED
 
 /* gcc supports the "unused" attribute on possibly unused labels, and
-   g++ has since version 4.5.  */
+   g++ has since version 4.5.  Note to support C++ as well as C,
+   _GL_UNUSED_LABEL should be used with a trailing ;  */
 #if !defined __cplusplus || __GNUC__ > 4 \
     || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
 # define _GL_UNUSED_LABEL _GL_UNUSED