From: Ben Walton Date: Mon, 2 Jun 2014 18:50:41 +0000 (+0100) Subject: rename: mark a label as potentially unused X-Git-Tag: v1.0~7366 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=451aebdc1d7374566d7d658d81bf26c79fe3d9ed;p=gnulib.git rename: mark a label as potentially unused * 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 --- diff --git a/lib/rename.c b/lib/rename.c index 2116028217..b99b0046ea 100644 --- a/lib/rename.c +++ b/lib/rename.c @@ -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) diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index 1bb316bb15..35f6195204 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -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