2009-12-23 Eric Blake <ebb9@byu.net>
+ gnulib-common: prefer _GL_UNUSED over _UNUSED_PARAMETER_
+ * m4/gnulib-common.m4 (gl_COMMON): Create a more-appropriately
+ named alias for __attribute__((__unused__)).
+ * lib/chown.c: Update client.
+ * lib/fchmodat.c: Likewise.
+ * lib/fts.c: Likewise.
+ * lib/getdate.y: Likewise.
+ * lib/getgroups.c: Likewise.
+ * lib/getopt.c: Likewise.
+ * lib/getugroups.c: Likewise.
+ * lib/mkdir.c: Likewise.
+ * lib/mkfifo.c: Likewise.
+ * lib/mkfifoat.c: Likewise.
+ * lib/mknod.c: Likewise.
+ * lib/mknodat.c: Likewise.
+ * lib/readlink.c: Likewise.
+ * lib/se-context.in.h: Likewise.
+ * lib/se-selinux.in.h: Likewise.
+ * lib/sockets.c: Likewise.
+ * lib/symlink.c: Likewise.
+ * lib/symlinkat.c: Likewise.
+ * lib/unicodeio.c: Likewise.
+ * lib/unistr.h: Likewise.
+ * tests/test-areadlink.c: Likewise.
+ * tests/test-areadlinkat.c: Likewise.
+ * tests/test-filenamecat.c: Likewise.
+ * tests/test-fseeko.c: Likewise.
+ * tests/test-ftello.c: Likewise.
+ * tests/test-getdate.c: Likewise.
+ * tests/test-getgroups.c: Likewise.
+ * tests/test-gethostname.c: Likewise.
+ * tests/test-quotearg.c: Likewise.
+ * tests/test-version-etc.c: Likewise.
+ * tests/test-xalloc-die.c: Likewise.
+ * tests/test-xfprintf-posix.c: Likewise.
+ * tests/test-xprintf-posix.c: Likewise.
+ * tests/test-xvasprintf.c: Likewise.
+
tests: avoid compiler warnings
* tests/test-fcntl.c (main): Delete unused parameters.
* tests/test-freopen-safer.c (main): Likewise.
/* Simple stub that always fails with ENOSYS, for mingw. */
int
-chown (const char *file _UNUSED_PARAMETER_, uid_t uid _UNUSED_PARAMETER_,
- gid_t gid _UNUSED_PARAMETER_)
+chown (const char *file _GL_UNUSED, uid_t uid _GL_UNUSED,
+ gid_t gid _GL_UNUSED)
{
errno = ENOSYS;
return -1;
# undef lchmod
# define lchmod lchmod_rpl
static int
-lchmod (char const *f _UNUSED_PARAMETER_, mode_t m _UNUSED_PARAMETER_)
+lchmod (char const *f _GL_UNUSED, mode_t m _GL_UNUSED)
{
errno = ENOSYS;
return -1;
#else
static bool
-dirent_inode_sort_may_be_useful (int dir_fd _UNUSED_PARAMETER_) { return true; }
+dirent_inode_sort_may_be_useful (int dir_fd _GL_UNUSED) { return true; }
static bool
-leaf_optimization_applies (int dir_fd _UNUSED_PARAMETER_) { return false; }
+leaf_optimization_applies (int dir_fd _GL_UNUSED) { return false; }
#endif
#if GNULIB_FTS
*/
/* ARGSUSED */
int
-fts_set(FTS *sp _UNUSED_PARAMETER_, FTSENT *p, int instr)
+fts_set(FTS *sp _GL_UNUSED, FTSENT *p, int instr)
{
if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
instr != FTS_NOINSTR && instr != FTS_SKIP) {
/* Do nothing if the parser reports an error. */
static int
-yyerror (parser_control const *pc _UNUSED_PARAMETER_,
- char const *s _UNUSED_PARAMETER_)
+yyerror (parser_control const *pc _GL_UNUSED,
+ char const *s _GL_UNUSED)
{
return 0;
}
/* Provide a stub that fails with ENOSYS, since there is no group
information available on mingw. */
int
-getgroups (int n _UNUSED_PARAMETER_, GETGROUPS_T *groups _UNUSED_PARAMETER_)
+getgroups (int n _GL_UNUSED, GETGROUPS_T *groups _GL_UNUSED)
{
errno = ENOSYS;
return -1;
/* Initialize the internal data when the first call is made. */
static const char *
-_getopt_initialize (int argc _UNUSED_PARAMETER_,
- char **argv _UNUSED_PARAMETER_, const char *optstring,
+_getopt_initialize (int argc _GL_UNUSED,
+ char **argv _GL_UNUSED, const char *optstring,
struct _getopt_data *d, int posixly_correct)
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
can do is fail with ENOSYS. */
int
-getugroups (int maxcount _UNUSED_PARAMETER_,
- gid_t *grouplist _UNUSED_PARAMETER_,
- char const *username _UNUSED_PARAMETER_,
- gid_t gid _UNUSED_PARAMETER_)
+getugroups (int maxcount _GL_UNUSED,
+ gid_t *grouplist _GL_UNUSED,
+ char const *username _GL_UNUSED,
+ gid_t gid _GL_UNUSED)
{
errno = ENOSYS;
return -1;
alias mkdir), only in the nonstandard io.h. */
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
# define mkdir(name,mode) _mkdir (name)
-# define maybe_unused _UNUSED_PARAMETER_
+# define maybe_unused _GL_UNUSED
#else
# define maybe_unused /* empty */
#endif
/* Mingw lacks mkfifo; always fail with ENOSYS. */
int
-mkfifo (char const *name _UNUSED_PARAMETER_, mode_t mode _UNUSED_PARAMETER_)
+mkfifo (char const *name _GL_UNUSED, mode_t mode _GL_UNUSED)
{
errno = ENOSYS;
return -1;
/* Mingw lacks mkfifo, so this wrapper is trivial. */
int
-mkfifoat (int fd _UNUSED_PARAMETER_, char const *path _UNUSED_PARAMETER_,
- mode_t mode _UNUSED_PARAMETER_)
+mkfifoat (int fd _GL_UNUSED, char const *path _GL_UNUSED,
+ mode_t mode _GL_UNUSED)
{
errno = ENOSYS;
return -1;
/* Mingw lacks mknod; always fail with ENOSYS. */
int
-mknod (char const *name _UNUSED_PARAMETER_, mode_t mode _UNUSED_PARAMETER_,
- dev_t dev _UNUSED_PARAMETER_)
+mknod (char const *name _GL_UNUSED, mode_t mode _GL_UNUSED,
+ dev_t dev _GL_UNUSED)
{
errno = ENOSYS;
return -1;
/* Mingw lacks mknod, so this wrapper is trivial. */
int
-mknodat (int fd _UNUSED_PARAMETER_, char const *path _UNUSED_PARAMETER_,
- mode_t mode _UNUSED_PARAMETER_, dev_t dev _UNUSED_PARAMETER_)
+mknodat (int fd _GL_UNUSED, char const *path _GL_UNUSED,
+ mode_t mode _GL_UNUSED, dev_t dev _GL_UNUSED)
{
errno = ENOSYS;
return -1;
such as DJGPP 2.03 and mingw32. */
ssize_t
-readlink (const char *name, char *buf _UNUSED_PARAMETER_,
- size_t bufsize _UNUSED_PARAMETER_)
+readlink (const char *name, char *buf _GL_UNUSED,
+ size_t bufsize _GL_UNUSED)
{
struct stat statbuf;
# include <errno.h>
typedef int context_t;
-static inline context_t context_new (char const *s _UNUSED_PARAMETER_)
+static inline context_t context_new (char const *s _GL_UNUSED)
{ errno = ENOTSUP; return 0; }
-static inline char *context_str (context_t con _UNUSED_PARAMETER_)
+static inline char *context_str (context_t con _GL_UNUSED)
{ errno = ENOTSUP; return (void *) 0; }
-static inline void context_free (context_t c _UNUSED_PARAMETER_) {}
+static inline void context_free (context_t c _GL_UNUSED) {}
-static inline int context_user_set (context_t sc _UNUSED_PARAMETER_,
- char const *s _UNUSED_PARAMETER_)
+static inline int context_user_set (context_t sc _GL_UNUSED,
+ char const *s _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int context_role_set (context_t sc _UNUSED_PARAMETER_,
- char const *s _UNUSED_PARAMETER_)
+static inline int context_role_set (context_t sc _GL_UNUSED,
+ char const *s _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int context_range_set (context_t sc _UNUSED_PARAMETER_,
- char const *s _UNUSED_PARAMETER_)
+static inline int context_range_set (context_t sc _GL_UNUSED,
+ char const *s _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int context_type_set (context_t sc _UNUSED_PARAMETER_,
- char const *s _UNUSED_PARAMETER_)
+static inline int context_type_set (context_t sc _GL_UNUSED,
+ char const *s _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
#endif
# define security_context_t char*
# define is_selinux_enabled() 0
-static inline int getcon (security_context_t *con _UNUSED_PARAMETER_)
+static inline int getcon (security_context_t *con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline void freecon (security_context_t con _UNUSED_PARAMETER_) {}
+static inline void freecon (security_context_t con _GL_UNUSED) {}
-static inline int getfscreatecon (security_context_t *con _UNUSED_PARAMETER_)
+static inline int getfscreatecon (security_context_t *con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int setfscreatecon (security_context_t con _UNUSED_PARAMETER_)
+static inline int setfscreatecon (security_context_t con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int matchpathcon (char const *file _UNUSED_PARAMETER_,
- mode_t m _UNUSED_PARAMETER_,
- security_context_t *con _UNUSED_PARAMETER_)
+static inline int matchpathcon (char const *file _GL_UNUSED,
+ mode_t m _GL_UNUSED,
+ security_context_t *con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int getfilecon (char const *file _UNUSED_PARAMETER_,
- security_context_t *con _UNUSED_PARAMETER_)
+static inline int getfilecon (char const *file _GL_UNUSED,
+ security_context_t *con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int lgetfilecon (char const *file _UNUSED_PARAMETER_,
- security_context_t *con _UNUSED_PARAMETER_)
+static inline int lgetfilecon (char const *file _GL_UNUSED,
+ security_context_t *con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
static inline int fgetfilecon (int fd,
- security_context_t *con _UNUSED_PARAMETER_)
+ security_context_t *con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int setfilecon (char const *file _UNUSED_PARAMETER_,
- security_context_t con _UNUSED_PARAMETER_)
+static inline int setfilecon (char const *file _GL_UNUSED,
+ security_context_t con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int lsetfilecon (char const *file _UNUSED_PARAMETER_,
- security_context_t con _UNUSED_PARAMETER_)
+static inline int lsetfilecon (char const *file _GL_UNUSED,
+ security_context_t con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int fsetfilecon (int fd _UNUSED_PARAMETER_,
- security_context_t con _UNUSED_PARAMETER_)
+static inline int fsetfilecon (int fd _GL_UNUSED,
+ security_context_t con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
static inline int security_check_context
- (security_context_t con _UNUSED_PARAMETER_)
+ (security_context_t con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
static inline int security_check_context_raw
- (security_context_t con _UNUSED_PARAMETER_)
+ (security_context_t con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
-static inline int setexeccon (security_context_t con _UNUSED_PARAMETER_)
+static inline int setexeccon (security_context_t con _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
static inline int security_compute_create
- (security_context_t scon _UNUSED_PARAMETER_,
- security_context_t tcon _UNUSED_PARAMETER_,
- security_class_t tclass _UNUSED_PARAMETER_,
- security_context_t *newcon _UNUSED_PARAMETER_)
+ (security_context_t scon _GL_UNUSED,
+ security_context_t tcon _GL_UNUSED,
+ security_class_t tclass _GL_UNUSED,
+ security_context_t *newcon _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
static inline int matchpathcon_init_prefix
- (char const *path _UNUSED_PARAMETER_,
- char const *prefix _UNUSED_PARAMETER_)
+ (char const *path _GL_UNUSED,
+ char const *prefix _GL_UNUSED)
{ errno = ENOTSUP; return -1; }
# endif
#endif /* WINDOWS_SOCKETS */
int
-gl_sockets_startup (int version _UNUSED_PARAMETER_)
+gl_sockets_startup (int version _GL_UNUSED)
{
#if WINDOWS_SOCKETS
if (version > initialized_sockets_version)
/* The system does not support symlinks. */
int
-symlink (char const *contents _UNUSED_PARAMETER_,
- char const *name _UNUSED_PARAMETER_)
+symlink (char const *contents _GL_UNUSED,
+ char const *name _GL_UNUSED)
{
errno = ENOSYS;
return -1;
# include <errno.h>
int
-symlinkat (char const *path1 _UNUSED_PARAMETER_, int fd _UNUSED_PARAMETER_,
- char const *path2 _UNUSED_PARAMETER_)
+symlinkat (char const *path1 _GL_UNUSED, int fd _GL_UNUSED,
+ char const *path2 _GL_UNUSED)
{
errno = ENOSYS;
return -1;
/* Simple failure callback that displays an error and exits. */
static long
exit_failure_callback (unsigned int code, const char *msg,
- void *callback_arg _UNUSED_PARAMETER_)
+ void *callback_arg _GL_UNUSED)
{
if (msg == NULL)
error (1, 0, _("cannot convert U+%04X to local character set"), code);
ASCII, using the same notation as ISO C99 strings. */
static long
fallback_failure_callback (unsigned int code,
- const char *msg _UNUSED_PARAMETER_,
+ const char *msg _GL_UNUSED,
void *callback_arg)
{
FILE *stream = (FILE *) callback_arg;
u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n);
# else
static inline int
-u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n _UNUSED_PARAMETER_)
+u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED)
{
uint32_t c = *s;
u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n);
# else
static inline int
-u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _UNUSED_PARAMETER_)
+u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED)
{
uint32_t c = *s;
# define __GNUC_STDC_INLINE__ 1
#endif])
AH_VERBATIM([unused_parameter],
-[/* Define as a marker that can be attached to function parameter declarations
- for parameters that are not used. This helps to reduce warnings, such as
- from GCC -Wunused-parameter. */
+[/* Define as a marker that can be attached to declarations that might not
+ be used. This helps to reduce warnings, such as from
+ GCC -Wunused-parameter. */
#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _UNUSED_PARAMETER_ __attribute__ ((__unused__))
+# define _GL_UNUSED __attribute__ ((__unused__))
#else
-# define _UNUSED_PARAMETER_
+# define _GL_UNUSED
#endif
+/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+ is a misnomer outside of parameter lists. */
+#define _UNUSED_PARAMETER_ _GL_UNUSED
])
])
/* Wrapper for testing areadlink. */
static char *
-do_areadlink (char const *name, size_t ignored _UNUSED_PARAMETER_)
+do_areadlink (char const *name, size_t ignored _GL_UNUSED)
{
return areadlink (name);
}
/* Wrapper for testing areadlinkat. */
static char *
-do_areadlinkat (char const *name, size_t ignored _UNUSED_PARAMETER_)
+do_areadlinkat (char const *name, size_t ignored _GL_UNUSED)
{
return areadlinkat (dfd, name);
}
#include "progname.h"
int
-main (int argc _UNUSED_PARAMETER_, char *argv[])
+main (int argc _GL_UNUSED, char *argv[])
{
static char const *const tests[][3] =
{
#endif
int
-main (int argc, char **argv _UNUSED_PARAMETER_)
+main (int argc, char **argv _GL_UNUSED)
{
/* Assume stdin is non-empty, seekable, and starts with '#!/bin/sh'
iff argc > 1. */
#endif
int
-main (int argc, char **argv _UNUSED_PARAMETER_)
+main (int argc, char **argv _GL_UNUSED)
{
int ch;
/* Assume stdin is seekable iff argc > 1. */
};
int
-main (int argc _UNUSED_PARAMETER_, char **argv)
+main (int argc _GL_UNUSED, char **argv)
{
struct timespec result;
struct timespec result2;
while (0)
int
-main (int argc, char **argv _UNUSED_PARAMETER_)
+main (int argc, char **argv _GL_UNUSED)
{
int result;
gid_t *groups;
#define NOHOSTNAME "magic-gnulib-test-string"
int
-main (int argc, char *argv[] _UNUSED_PARAMETER_)
+main (int argc, char *argv[] _GL_UNUSED)
{
char buf[HOST_NAME_MAX];
int rc;
}
int
-main (int argc _UNUSED_PARAMETER_, char *argv[])
+main (int argc _GL_UNUSED, char *argv[])
{
int i;
bool ascii_only = MB_CUR_MAX == 1 && !isprint ((unsigned char) LQ[0]);
#define AUTHORS "Sergey Poznyakoff", "Eric Blake"
int
-main (int argc _UNUSED_PARAMETER_, char **argv)
+main (int argc _GL_UNUSED, char **argv)
{
set_program_name (argv[0]);
version_etc (stdout, "test-version-etc", "dummy", "0", AUTHORS,
#include "progname.h"
int
-main (int argc _UNUSED_PARAMETER_, char **argv)
+main (int argc _GL_UNUSED, char **argv)
{
set_program_name (argv[0]);
xalloc_die ();
#include "test-fprintf-posix.h"
int
-main (int argc _UNUSED_PARAMETER_, char *argv[])
+main (int argc _GL_UNUSED, char *argv[])
{
set_program_name (argv[0]);
#include "test-printf-posix.h"
int
-main (int argc _UNUSED_PARAMETER_, char *argv[])
+main (int argc _GL_UNUSED, char *argv[])
{
set_program_name (argv[0]);
}
int
-main (int argc _UNUSED_PARAMETER_, char *argv[])
+main (int argc _GL_UNUSED, char *argv[])
{
set_program_name (argv[0]);