+2021-08-22 Bruno Haible <bruno@clisp.org>
+
+ gnulib-common.m4: Use C2x [[maybe_unused]] when possible.
+ * m4/gnulib-common.m4 (gl_COMMON_BODY): Define _GL_UNUSED as an alias of
+ _GL_ATTRIBUTE_MAYBE_UNUSED, not of _GL_ATTRIBUTE_UNUSED.
+ * lib/binary-io.h (__gl_setmode): Put _GL_UNUSED before, not after, the
+ declaration.
+ * lib/c-stack.c (null_action, segv_handler, overflow_handler,
+ c_stack_action): Likewise.
+ * lib/chown.c (chown): Likewise.
+ * lib/clean-temp-simple.c (cleanup_action): Likewise.
+ * lib/fts.c (dirent_inode_sort_may_be_useful, leaf_optimization,
+ fts_set): Likewise.
+ * lib/getgroups.c (getgroups): Likewise.
+ * lib/getopt.c (_getopt_initialize): Likewise.
+ * lib/getugroups.c (getugroups): Likewise.
+ * lib/localename.c (gl_locale_name_thread_unsafe, gl_locale_name_thread,
+ gl_locale_name_posix, gl_locale_name_environ): Likewise.
+ * lib/mkdir.c (rpl_mkdir): Likewise.
+ * lib/mkfifo.c (mkfifo): Likewise.
+ * lib/mkfifoat.c (mkfifoat): Likewise.
+ * lib/mknod.c (mknod): Likewise.
+ * lib/mknodat.c (mknodat): Likewise.
+ * lib/mountlist.c (me_remote): Likewise.
+ * lib/openpty.c (openpty): Likewise.
+ * lib/parse-datetime.y (yyerror): Likewise.
+ * lib/passfd.c (sendfd, recvfd): Likewise.
+ * lib/pthread-cond.c (pthread_condattr_destroy, pthread_cond_init,
+ pthread_cond_wait, pthread_cond_timedwait, pthread_cond_signal,
+ pthread_cond_broadcast, pthread_cond_destroy): Likewise.
+ * lib/pthread-mutex.c (pthread_mutexattr_destroy, pthread_mutex_init,
+ pthread_mutex_lock, pthread_mutex_trylock, pthread_mutex_timedlock,
+ pthread_mutex_unlock, pthread_mutex_destroy): Likewise.
+ * lib/pthread-rwlock.c (pthread_rwlockattr_destroy, pthread_rwlock_init,
+ pthread_rwlock_timedrdlock, pthread_rwlock_timedwrlock): Likewise.
+ * lib/pthread-spin.c (pthread_spin_init, pthread_spin_lock,
+ pthread_spin_trylock, pthread_spin_unlock, pthread_spin_destroy):
+ Likewise.
+ * lib/pthread-thread.c (pthread_attr_destroy): Likewise.
+ * lib/readlink.c (readlink): Likewise.
+ * lib/rename.c (rpl_rename): Likewise.
+ * lib/set-permissions.c (set_permissions): Likewise.
+ * lib/sockets.c (gl_sockets_startup): Likewise.
+ * lib/stat-time.h (get_stat_birthtime_ns, get_stat_birthtime,
+ stat_time_normalize): Likewise.
+ * lib/strptime.c (__strptime_internal): Likewise.
+ * lib/strtod.c (LDEXP): Likewise.
+ * lib/symlink.c (symlink): Likewise.
+ * lib/symlinkat.c (symlinkat): Likewise.
+ * lib/tempname.c (try_dir, try_nocreate): Likewise.
+ * lib/textstyle.in.h (styled_ostream_begin_use_class,
+ styled_ostream_end_use_class, styled_ostream_get_hyperlink_ref,
+ styled_ostream_get_hyperlink_id, styled_ostream_set_hyperlink,
+ styled_ostream_flush_to_current_style, fd_ostream_create,
+ term_ostream_get_color, term_ostream_set_color,
+ term_ostream_get_bgcolor, term_ostream_set_bgcolor,
+ term_ostream_get_weight, term_ostream_set_weight,
+ term_ostream_get_posture, term_ostream_set_posture,
+ term_ostream_get_underline, term_ostream_set_underline,
+ term_ostream_get_hyperlink_ref, term_ostream_get_hyperlink_id,
+ term_ostream_set_hyperlink, term_ostream_create,
+ term_styled_ostream_create, html_styled_ostream_create,
+ handle_color_option, handle_style_option, style_file_prepare,
+ styled_ostream_create, libtextstyle_set_failure_exit_code): Likewise.
+ * lib/unicodeio.c (exit_failure_callback, fallback_failure_callback):
+ Likewise.
+ * lib/wait-process.c (cleanup_slaves_action): Likewise.
+ * tests/signature.h (SIGNATURE_CHECK2): Likewise.
+ * tests/test-areadlink.c (do_areadlink): Likewise.
+ * tests/test-areadlinkat.c (do_areadlinkat): Likewise.
+ * tests/test-ceilf-ieee.c (main): Likewise.
+ * tests/test-ceilf1.c (main): Likewise.
+ * tests/test-dirent.c (dir): Likewise.
+ * tests/test-fchownat.c (main): Likewise.
+ * tests/test-fdopendir.c (main): Likewise.
+ * tests/test-filenamecat.c (main): Likewise.
+ * tests/test-floor1.c (main): Likewise.
+ * tests/test-floorf-ieee.c (main): Likewise.
+ * tests/test-floorf1.c (main): Likewise.
+ * tests/test-fseeko.c (main): Likewise.
+ * tests/test-fstatat.c (main): Likewise.
+ * tests/test-ftello.c (main): Likewise.
+ * tests/test-getdomainname.c (main): Likewise.
+ * tests/test-getgroups.c (main): Likewise.
+ * tests/test-gethostname.c (main): Likewise.
+ * tests/test-math-c++.cc (OVERLOADED_CHECK): Likewise.
+ * tests/test-mkdirat.c (main): Likewise.
+ * tests/test-openat.c (main): Likewise.
+ * tests/test-parse-datetime.c (main): Likewise.
+ * tests/test-quotearg-simple.c (main): Likewise.
+ * tests/test-quotearg.c (main): Likewise.
+ * tests/test-sethostname2.c (main): Likewise.
+ * tests/test-unlinkat.c (main): Likewise.
+ * tests/test-version-etc.c (main): Likewise.
+ * tests/test-xalloc-die.c (main): Likewise.
+ * tests/test-xfprintf-posix.c (main): Likewise.
+ * tests/test-xprintf-posix.c (main): Likewise.
+ * tests/test-xvasprintf.c (main): Likewise.
+
2021-08-22 Bruno Haible <bruno@clisp.org>
gnulib-common.m4: Document the gnulib-internal _GL_ATTRIBUTE_* macros.
/* Use a function rather than a macro, to avoid gcc warnings
"warning: statement with no effect". */
BINARY_IO_INLINE int
-__gl_setmode (int fd _GL_UNUSED, int mode _GL_UNUSED)
+__gl_setmode (_GL_UNUSED int fd, _GL_UNUSED int mode)
{
return O_BINARY;
}
}
static _GL_ASYNC_SAFE void
-null_action (int signo _GL_UNUSED)
+null_action (_GL_UNUSED int signo)
{
}
overflow. This function is async-signal-safe. */
static _GL_ASYNC_SAFE int
-segv_handler (void *address _GL_UNUSED, int serious)
+segv_handler (_GL_UNUSED void *address, int serious)
{
# if DEBUG
{
overflow and exit. This function is async-signal-safe. */
static _GL_ASYNC_SAFE _Noreturn void
-overflow_handler (int emergency, stackoverflow_context_t context _GL_UNUSED)
+overflow_handler (int emergency, _GL_UNUSED stackoverflow_context_t context)
{
# if DEBUG
{
#else /* !HAVE_STACK_OVERFLOW_RECOVERY */
int
-c_stack_action (_GL_ASYNC_SAFE void (*action) (int) _GL_UNUSED)
+c_stack_action (_GL_ASYNC_SAFE void (*action) (_GL_UNUSED int) )
{
errno = ENOTSUP;
return -1;
/* Simple stub that always fails with ENOSYS, for mingw. */
int
-chown (const char *file _GL_UNUSED, uid_t uid _GL_UNUSED,
- gid_t gid _GL_UNUSED)
+chown (_GL_UNUSED const char *file, _GL_UNUSED uid_t uid,
+ _GL_UNUSED gid_t gid)
{
errno = ENOSYS;
return -1;
/* The signal handler. It gets called asynchronously. */
static _GL_ASYNC_SAFE void
-cleanup_action (int sig _GL_UNUSED)
+cleanup_action (_GL_UNUSED int sig)
{
size_t i;
--- /dev/null
+int foo (int x)
+{
+ x += 2;
+ if (x & 1)
+ goto a;
+b:
+__attribute__ ((__maybe_unused__));
+ x *= 3;
+a:
+ return x;
+}
--- /dev/null
+ .text
+ .file "foo.c"
+ .globl _Z3fooi # -- Begin function _Z3fooi
+ .p2align 4, 0x90
+ .type _Z3fooi,@function
+_Z3fooi: # @_Z3fooi
+ .cfi_startproc
+# %bb.0:
+ pushq %rbp
+ .cfi_def_cfa_offset 16
+ .cfi_offset %rbp, -16
+ movq %rsp, %rbp
+ .cfi_def_cfa_register %rbp
+ movl %edi, -4(%rbp)
+ movl -4(%rbp), %eax
+ addl $2, %eax
+ movl %eax, -4(%rbp)
+ movl -4(%rbp), %eax
+ andl $1, %eax
+ cmpl $0, %eax
+ je .LBB0_2
+# %bb.1:
+ jmp .LBB0_4
+.LBB0_2:
+ jmp .LBB0_3
+.LBB0_3:
+ imull $3, -4(%rbp), %eax
+ movl %eax, -4(%rbp)
+.LBB0_4:
+ movl -4(%rbp), %eax
+ popq %rbp
+ .cfi_def_cfa %rsp, 8
+ retq
+.Lfunc_end0:
+ .size _Z3fooi, .Lfunc_end0-_Z3fooi
+ .cfi_endproc
+ # -- End function
+ .ident "clang version 11.0.0"
+ .section ".note.GNU-stack","",@progbits
+ .addrsig
#else
static bool
-dirent_inode_sort_may_be_useful (FTSENT const *p _GL_UNUSED,
- int dir_fd _GL_UNUSED)
+dirent_inode_sort_may_be_useful (_GL_UNUSED FTSENT const *p,
+ _GL_UNUSED int dir_fd)
{
return true;
}
static enum leaf_optimization
-leaf_optimization (FTSENT const *p _GL_UNUSED, int dir_fd _GL_UNUSED)
+leaf_optimization (_GL_UNUSED FTSENT const *p, _GL_UNUSED int dir_fd)
{
return NO_LEAF_OPTIMIZATION;
}
*/
/* ARGSUSED */
int
-fts_set(FTS *sp _GL_UNUSED, FTSENT *p, int instr)
+fts_set(_GL_UNUSED FTS *sp, FTSENT *p, int instr)
{
if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
instr != FTS_NOINSTR && instr != FTS_SKIP) {
/* Provide a stub that fails with ENOSYS, since there is no group
information available on mingw. */
int
-getgroups (int n _GL_UNUSED, GETGROUPS_T *groups _GL_UNUSED)
+getgroups (_GL_UNUSED int n, _GL_UNUSED GETGROUPS_T *groups)
{
errno = ENOSYS;
return -1;
/* Initialize internal data upon the first call to getopt. */
static const char *
-_getopt_initialize (int argc _GL_UNUSED,
- char **argv _GL_UNUSED, const char *optstring,
+_getopt_initialize (_GL_UNUSED int argc,
+ _GL_UNUSED char **argv, const char *optstring,
struct _getopt_data *d, int posixly_correct)
{
/* Start processing options with ARGV-element 1 (since ARGV-element 0
defined in the library. */
int
-getugroups (int maxcount _GL_UNUSED,
- gid_t *grouplist _GL_UNUSED,
- char const *username _GL_UNUSED,
- gid_t gid _GL_UNUSED)
+getugroups (_GL_UNUSED int maxcount,
+ _GL_UNUSED gid_t *grouplist,
+ _GL_UNUSED char const *username,
+ _GL_UNUSED gid_t gid)
{
errno = ENOSYS;
return -1;
static
# endif
const char *
-gl_locale_name_thread_unsafe (int category, const char *categoryname _GL_UNUSED)
+gl_locale_name_thread_unsafe (int category, _GL_UNUSED const char *categoryname)
{
# if HAVE_GOOD_USELOCALE
{
#endif
const char *
-gl_locale_name_thread (int category, const char *categoryname _GL_UNUSED)
+gl_locale_name_thread (int category, _GL_UNUSED const char *categoryname)
{
#if HAVE_GOOD_USELOCALE
const char *name = gl_locale_name_thread_unsafe (category, categoryname);
#endif
const char *
-gl_locale_name_posix (int category, const char *categoryname _GL_UNUSED)
+gl_locale_name_posix (int category, _GL_UNUSED const char *categoryname)
{
#if defined WINDOWS_NATIVE
if (LC_MIN <= category && category <= LC_MAX)
}
const char *
-gl_locale_name_environ (int category _GL_UNUSED, const char *categoryname)
+gl_locale_name_environ (_GL_UNUSED int category, const char *categoryname)
{
const char *retval;
/* This function is required at least for NetBSD 1.5.2. */
int
-rpl_mkdir (char const *dir, mode_t mode maybe_unused)
+rpl_mkdir (char const *dir, maybe_unused mode_t mode)
{
int ret_val;
char *tmp_dir;
/* Mingw lacks mkfifo; always fail with ENOSYS. */
int
-mkfifo (char const *name _GL_UNUSED, mode_t mode _GL_UNUSED)
+mkfifo (_GL_UNUSED char const *name, _GL_UNUSED mode_t mode)
{
errno = ENOSYS;
return -1;
/* Mingw lacks mkfifo, so this wrapper is trivial. */
int
-mkfifoat (int fd _GL_UNUSED, char const *path _GL_UNUSED,
- mode_t mode _GL_UNUSED)
+mkfifoat (_GL_UNUSED int fd, _GL_UNUSED char const *path,
+ _GL_UNUSED mode_t mode)
{
errno = ENOSYS;
return -1;
/* Mingw lacks mknod; always fail with ENOSYS. */
int
-mknod (char const *name _GL_UNUSED, mode_t mode _GL_UNUSED,
- dev_t dev _GL_UNUSED)
+mknod (_GL_UNUSED char const *name, _GL_UNUSED mode_t mode,
+ _GL_UNUSED dev_t dev)
{
errno = ENOSYS;
return -1;
/* Mingw lacks mknod, so this wrapper is trivial. */
int
-mknodat (int fd _GL_UNUSED, char const *path _GL_UNUSED,
- mode_t mode _GL_UNUSED, dev_t dev _GL_UNUSED)
+mknodat (_GL_UNUSED int fd, _GL_UNUSED char const *path,
+ _GL_UNUSED mode_t mode, _GL_UNUSED dev_t dev)
{
errno = ENOSYS;
return -1;
/* All cygwin mount points include ':' or start with '//'; so it
requires a native Windows call to determine remote disks. */
static bool
-me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
+me_remote (char const *fs_name, _GL_UNUSED char const *fs_type)
{
if (fs_name[0] && fs_name[1] == ':')
{
# include <errno.h>
int
-openpty (int *amaster _GL_UNUSED, int *aslave _GL_UNUSED,
- char *name _GL_UNUSED,
- struct termios const *termp _GL_UNUSED,
- struct winsize const *winp _GL_UNUSED)
+openpty (_GL_UNUSED int *amaster, _GL_UNUSED int *aslave,
+ _GL_UNUSED char *name,
+ _GL_UNUSED struct termios const *termp,
+ _GL_UNUSED struct winsize const *winp)
{
/* Mingw lacks pseudo-terminals altogether. */
errno = ENOSYS;
/* Do nothing if the parser reports an error. */
static int
-yyerror (parser_control const *pc _GL_UNUSED,
- char const *s _GL_UNUSED)
+yyerror (_GL_UNUSED parser_control const *pc,
+ _GL_UNUSED char const *s)
{
return 0;
}
}
#else
int
-sendfd (int sock _GL_UNUSED, int fd _GL_UNUSED)
+sendfd (_GL_UNUSED int sock, _GL_UNUSED int fd)
{
errno = ENOSYS;
return -1;
}
#else
int
-recvfd (int sock _GL_UNUSED, int flags _GL_UNUSED)
+recvfd (_GL_UNUSED int sock, _GL_UNUSED int flags)
{
errno = ENOSYS;
return -1;
}
int
-pthread_condattr_destroy (pthread_condattr_t *attr _GL_UNUSED)
+pthread_condattr_destroy (_GL_UNUSED pthread_condattr_t *attr)
{
return 0;
}
int
pthread_cond_init (pthread_cond_t *cond,
- const pthread_condattr_t *attr _GL_UNUSED)
+ _GL_UNUSED const pthread_condattr_t *attr)
{
return glwthread_cond_init (cond);
}
/* Provide a dummy implementation for single-threaded applications. */
int
-pthread_cond_init (pthread_cond_t *cond _GL_UNUSED,
- const pthread_condattr_t *attr _GL_UNUSED)
+pthread_cond_init (_GL_UNUSED pthread_cond_t *cond,
+ _GL_UNUSED const pthread_condattr_t *attr)
{
/* COND is never seriously used. */
return 0;
}
int
-pthread_cond_wait (pthread_cond_t *cond _GL_UNUSED,
- pthread_mutex_t *mutex _GL_UNUSED)
+pthread_cond_wait (_GL_UNUSED pthread_cond_t *cond,
+ _GL_UNUSED pthread_mutex_t *mutex)
{
/* No other thread can signal this condition variable.
Wait endlessly. */
}
int
-pthread_cond_timedwait (pthread_cond_t *cond _GL_UNUSED,
- pthread_mutex_t *mutex _GL_UNUSED,
+pthread_cond_timedwait (_GL_UNUSED pthread_cond_t *cond,
+ _GL_UNUSED pthread_mutex_t *mutex,
const struct timespec *abstime)
{
/* No other thread can signal this condition variable.
}
int
-pthread_cond_signal (pthread_cond_t *cond _GL_UNUSED)
+pthread_cond_signal (_GL_UNUSED pthread_cond_t *cond)
{
/* No threads can currently be blocked on COND. */
return 0;
}
int
-pthread_cond_broadcast (pthread_cond_t *cond _GL_UNUSED)
+pthread_cond_broadcast (_GL_UNUSED pthread_cond_t *cond)
{
/* No threads can currently be blocked on COND. */
return 0;
}
int
-pthread_cond_destroy (pthread_cond_t *cond _GL_UNUSED)
+pthread_cond_destroy (_GL_UNUSED pthread_cond_t *cond)
{
/* COND is never seriously used. */
return 0;
}
int
-pthread_mutexattr_destroy (pthread_mutexattr_t *attr _GL_UNUSED)
+pthread_mutexattr_destroy (_GL_UNUSED pthread_mutexattr_t *attr)
{
return 0;
}
/* Provide a dummy implementation for single-threaded applications. */
int
-pthread_mutex_init (pthread_mutex_t *mutex _GL_UNUSED,
- const pthread_mutexattr_t *attr _GL_UNUSED)
+pthread_mutex_init (_GL_UNUSED pthread_mutex_t *mutex,
+ _GL_UNUSED const pthread_mutexattr_t *attr)
{
/* MUTEX is never seriously used. */
return 0;
}
int
-pthread_mutex_lock (pthread_mutex_t *mutex _GL_UNUSED)
+pthread_mutex_lock (_GL_UNUSED pthread_mutex_t *mutex)
{
/* There is only one thread, so it always gets the lock. This
implementation does not support PTHREAD_MUTEX_ERRORCHECK. */
}
int
-pthread_mutex_trylock (pthread_mutex_t *mutex _GL_UNUSED)
+pthread_mutex_trylock (_GL_UNUSED pthread_mutex_t *mutex)
{
/* There is only one thread, so it always gets the lock. This
implementation does not support PTHREAD_MUTEX_ERRORCHECK. */
}
int
-pthread_mutex_timedlock (pthread_mutex_t *mutex _GL_UNUSED,
- const struct timespec *abstime _GL_UNUSED)
+pthread_mutex_timedlock (_GL_UNUSED pthread_mutex_t *mutex,
+ _GL_UNUSED const struct timespec *abstime)
{
/* There is only one thread, so it always gets the lock. This
implementation does not support PTHREAD_MUTEX_ERRORCHECK. */
}
int
-pthread_mutex_unlock (pthread_mutex_t *mutex _GL_UNUSED)
+pthread_mutex_unlock (_GL_UNUSED pthread_mutex_t *mutex)
{
/* There is only one thread, so it always unlocks successfully.
This implementation does not support robust mutexes or
}
int
-pthread_mutex_destroy (pthread_mutex_t *mutex _GL_UNUSED)
+pthread_mutex_destroy (_GL_UNUSED pthread_mutex_t *mutex)
{
/* MUTEX is never seriously used. */
return 0;
}
int
-pthread_rwlockattr_destroy (pthread_rwlockattr_t *attr _GL_UNUSED)
+pthread_rwlockattr_destroy (_GL_UNUSED pthread_rwlockattr_t *attr)
{
return 0;
}
int
pthread_rwlock_init (pthread_rwlock_t *lock,
- const pthread_rwlockattr_t *attr _GL_UNUSED)
+ _GL_UNUSED const pthread_rwlockattr_t *attr)
{
glwthread_timedrwlock_init (lock);
return 0;
int
pthread_rwlock_init (pthread_rwlock_t *lock,
- const pthread_rwlockattr_t *attr _GL_UNUSED)
+ _GL_UNUSED const pthread_rwlockattr_t *attr)
{
int err;
int
pthread_rwlock_init (pthread_rwlock_t *lock,
- const pthread_rwlockattr_t *attr _GL_UNUSED)
+ _GL_UNUSED const pthread_rwlockattr_t *attr)
{
*lock = 0;
return 0;
int
pthread_rwlock_timedrdlock (pthread_rwlock_t *lock,
- const struct timespec *abstime _GL_UNUSED)
+ _GL_UNUSED const struct timespec *abstime)
{
return pthread_rwlock_rdlock (lock);
}
int
pthread_rwlock_timedwrlock (pthread_rwlock_t *lock,
- const struct timespec *abstime _GL_UNUSED)
+ _GL_UNUSED const struct timespec *abstime)
{
return pthread_rwlock_wrlock (lock);
}
int
pthread_spin_init (pthread_spinlock_t *lock,
- int shared_across_processes _GL_UNUSED)
+ _GL_UNUSED int shared_across_processes)
{
glwthread_spin_init (lock);
return 0;
int
pthread_spin_init (pthread_spinlock_t *lock,
- int shared_across_processes _GL_UNUSED)
+ _GL_UNUSED int shared_across_processes)
{
__atomic_store_n ((unsigned int *) lock, 0, __ATOMIC_SEQ_CST);
return 0;
int
pthread_spin_init (pthread_spinlock_t *lock,
- int shared_across_processes _GL_UNUSED)
+ _GL_UNUSED int shared_across_processes)
{
__atomic_clear (lock, __ATOMIC_SEQ_CST);
return 0;
int
pthread_spin_init (pthread_spinlock_t *lock,
- int shared_across_processes _GL_UNUSED)
+ _GL_UNUSED int shared_across_processes)
{
* (volatile unsigned int *) lock = 0;
__sync_synchronize ();
int
pthread_spin_init (pthread_spinlock_t *lock,
- int shared_across_processes _GL_UNUSED)
+ _GL_UNUSED int shared_across_processes)
{
return pthread_mutex_init (lock, NULL);
}
/* Provide a dummy implementation for single-threaded applications. */
int
-pthread_spin_init (pthread_spinlock_t *lock _GL_UNUSED,
- int shared_across_processes _GL_UNUSED)
+pthread_spin_init (_GL_UNUSED pthread_spinlock_t *lock,
+ _GL_UNUSED int shared_across_processes)
{
return 0;
}
int
-pthread_spin_lock (pthread_spinlock_t *lock _GL_UNUSED)
+pthread_spin_lock (_GL_UNUSED pthread_spinlock_t *lock)
{
return 0;
}
int
-pthread_spin_trylock (pthread_spinlock_t *lock _GL_UNUSED)
+pthread_spin_trylock (_GL_UNUSED pthread_spinlock_t *lock)
{
return 0;
}
int
-pthread_spin_unlock (pthread_spinlock_t *lock _GL_UNUSED)
+pthread_spin_unlock (_GL_UNUSED pthread_spinlock_t *lock)
{
return 0;
}
int
-pthread_spin_destroy (pthread_spinlock_t *lock _GL_UNUSED)
+pthread_spin_destroy (_GL_UNUSED pthread_spinlock_t *lock)
{
return 0;
}
}
int
-pthread_attr_destroy (pthread_attr_t *attr _GL_UNUSED)
+pthread_attr_destroy (_GL_UNUSED pthread_attr_t *attr)
{
return 0;
}
such as DJGPP 2.03 and mingw32. */
ssize_t
-readlink (char const *file, char *buf _GL_UNUSED,
- size_t bufsize _GL_UNUSED)
+readlink (char const *file, _GL_UNUSED char *buf,
+ _GL_UNUSED size_t bufsize)
{
struct stat statbuf;
char *dst_temp = (char *) dst;
bool src_slash;
bool dst_slash;
- bool dst_exists _GL_UNUSED;
+ _GL_UNUSED bool dst_exists;
int ret_val = -1;
int rename_errno = ENOTDIR;
struct stat src_st;
int
set_permissions (struct permission_context *ctx, const char *name, int desc)
{
- bool acls_set _GL_UNUSED = false;
+ _GL_UNUSED bool acls_set = false;
bool early_chmod;
bool must_chmod = false;
int ret = 0;
#endif /* WINDOWS_SOCKETS */
int
-gl_sockets_startup (int version _GL_UNUSED)
+gl_sockets_startup (_GL_UNUSED int version)
{
#if WINDOWS_SOCKETS
if (version > initialized_sockets_version)
/* Return the nanosecond component of *ST's birth time. */
_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
-get_stat_birthtime_ns (struct stat const *st _GL_UNUSED)
+get_stat_birthtime_ns (_GL_UNUSED struct stat const *st)
{
# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
return STAT_TIMESPEC (st, st_birthtim).tv_nsec;
/* Return *ST's birth time, if available; otherwise return a value
with tv_sec and tv_nsec both equal to -1. */
_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
-get_stat_birthtime (struct stat const *st _GL_UNUSED)
+get_stat_birthtime (_GL_UNUSED struct stat const *st)
{
struct timespec t;
errno to EOVERFLOW if normalization overflowed. This function
is intended to be private to this .h file. */
_GL_STAT_TIME_INLINE int
-stat_time_normalize (int result, struct stat *st _GL_UNUSED)
+stat_time_normalize (int result, _GL_UNUSED struct stat *st)
{
#if defined __sun && defined STAT_TIMESPEC
if (result == 0)
specify hours. If fours digits are used, minutes are
also specified. */
{
- bool neg _GL_UNUSED;
+ _GL_UNUSED bool neg;
int n;
val = 0;
#undef LDEXP
#define LDEXP dummy_ldexp
/* A dummy definition that will never be invoked. */
- static DOUBLE LDEXP (DOUBLE x _GL_UNUSED, int exponent _GL_UNUSED)
+ static DOUBLE LDEXP (_GL_UNUSED DOUBLE x, _GL_UNUSED int exponent)
{
abort ();
return L_(0.0);
/* The system does not support symlinks. */
int
-symlink (char const *contents _GL_UNUSED,
- char const *name _GL_UNUSED)
+symlink (_GL_UNUSED char const *contents,
+ _GL_UNUSED char const *name)
{
errno = ENOSYS;
return -1;
wrapper than to go through at-func.c to call rpl_symlink. */
int
-symlinkat (char const *path1 _GL_UNUSED, int fd _GL_UNUSED,
- char const *path2 _GL_UNUSED)
+symlinkat (_GL_UNUSED char const *path1, _GL_UNUSED int fd,
+ _GL_UNUSED char const *path2)
{
errno = ENOSYS;
return -1;
}
static int
-try_dir (char *tmpl, void *flags _GL_UNUSED)
+try_dir (char *tmpl, _GL_UNUSED void *flags)
{
return __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
}
static int
-try_nocreate (char *tmpl, void *flags _GL_UNUSED)
+try_nocreate (char *tmpl, _GL_UNUSED void *flags)
{
struct_stat64 st;
#define styled_ostream_free ostream_free
static inline void
-styled_ostream_begin_use_class (styled_ostream_t stream _GL_UNUSED,
- const char *classname _GL_UNUSED)
+styled_ostream_begin_use_class (_GL_UNUSED styled_ostream_t stream,
+ _GL_UNUSED const char *classname)
{
}
static inline void
-styled_ostream_end_use_class (styled_ostream_t stream _GL_UNUSED,
- const char *classname _GL_UNUSED)
+styled_ostream_end_use_class (_GL_UNUSED styled_ostream_t stream,
+ _GL_UNUSED const char *classname)
{
}
static inline const char *
-styled_ostream_get_hyperlink_ref (styled_ostream_t stream _GL_UNUSED)
+styled_ostream_get_hyperlink_ref (_GL_UNUSED styled_ostream_t stream)
{
return NULL;
}
static inline const char *
-styled_ostream_get_hyperlink_id (styled_ostream_t stream _GL_UNUSED)
+styled_ostream_get_hyperlink_id (_GL_UNUSED styled_ostream_t stream)
{
return NULL;
}
static inline void
-styled_ostream_set_hyperlink (styled_ostream_t stream _GL_UNUSED,
- const char *ref _GL_UNUSED,
- const char *id _GL_UNUSED)
+styled_ostream_set_hyperlink (_GL_UNUSED styled_ostream_t stream,
+ _GL_UNUSED const char *ref,
+ _GL_UNUSED const char *id)
{
}
static inline void
-styled_ostream_flush_to_current_style (styled_ostream_t stream _GL_UNUSED)
+styled_ostream_flush_to_current_style (_GL_UNUSED styled_ostream_t stream)
{
}
#define fd_ostream_free ostream_free
static inline fd_ostream_t
-fd_ostream_create (int fd, const char *filename _GL_UNUSED,
- bool buffered _GL_UNUSED)
+fd_ostream_create (int fd, _GL_UNUSED const char *filename,
+ _GL_UNUSED bool buffered)
{
if (fd == 1)
return stdout;
#define term_ostream_free ostream_free
static inline term_color_t
-term_ostream_get_color (term_ostream_t stream _GL_UNUSED)
+term_ostream_get_color (_GL_UNUSED term_ostream_t stream)
{
return COLOR_DEFAULT;
}
static inline void
-term_ostream_set_color (term_ostream_t stream _GL_UNUSED,
- term_color_t color _GL_UNUSED)
+term_ostream_set_color (_GL_UNUSED term_ostream_t stream,
+ _GL_UNUSED term_color_t color)
{
}
static inline term_color_t
-term_ostream_get_bgcolor (term_ostream_t stream _GL_UNUSED)
+term_ostream_get_bgcolor (_GL_UNUSED term_ostream_t stream)
{
return COLOR_DEFAULT;
}
static inline void
-term_ostream_set_bgcolor (term_ostream_t stream _GL_UNUSED,
- term_color_t color _GL_UNUSED)
+term_ostream_set_bgcolor (_GL_UNUSED term_ostream_t stream,
+ _GL_UNUSED term_color_t color)
{
}
static inline term_weight_t
-term_ostream_get_weight (term_ostream_t stream _GL_UNUSED)
+term_ostream_get_weight (_GL_UNUSED term_ostream_t stream)
{
return WEIGHT_DEFAULT;
}
static inline void
-term_ostream_set_weight (term_ostream_t stream _GL_UNUSED,
- term_weight_t weight _GL_UNUSED)
+term_ostream_set_weight (_GL_UNUSED term_ostream_t stream,
+ _GL_UNUSED term_weight_t weight)
{
}
static inline term_posture_t
-term_ostream_get_posture (term_ostream_t stream _GL_UNUSED)
+term_ostream_get_posture (_GL_UNUSED term_ostream_t stream)
{
return POSTURE_DEFAULT;
}
static inline void
-term_ostream_set_posture (term_ostream_t stream _GL_UNUSED,
- term_posture_t posture _GL_UNUSED)
+term_ostream_set_posture (_GL_UNUSED term_ostream_t stream,
+ _GL_UNUSED term_posture_t posture)
{
}
static inline term_underline_t
-term_ostream_get_underline (term_ostream_t stream _GL_UNUSED)
+term_ostream_get_underline (_GL_UNUSED term_ostream_t stream)
{
return UNDERLINE_DEFAULT;
}
static inline void
-term_ostream_set_underline (term_ostream_t stream _GL_UNUSED,
- term_underline_t underline _GL_UNUSED)
+term_ostream_set_underline (_GL_UNUSED term_ostream_t stream,
+ _GL_UNUSED term_underline_t underline)
{
}
static inline const char *
-term_ostream_get_hyperlink_ref (term_ostream_t stream _GL_UNUSED)
+term_ostream_get_hyperlink_ref (_GL_UNUSED term_ostream_t stream)
{
return NULL;
}
static inline const char *
-term_ostream_get_hyperlink_id (term_ostream_t stream _GL_UNUSED)
+term_ostream_get_hyperlink_id (_GL_UNUSED term_ostream_t stream)
{
return NULL;
}
static inline void
-term_ostream_set_hyperlink (term_ostream_t stream _GL_UNUSED,
- const char *ref _GL_UNUSED,
- const char *id _GL_UNUSED)
+term_ostream_set_hyperlink (_GL_UNUSED term_ostream_t stream,
+ _GL_UNUSED const char *ref,
+ _GL_UNUSED const char *id)
{
}
static inline term_ostream_t
term_ostream_create (int fd, const char *filename,
- ttyctl_t tty_control _GL_UNUSED)
+ _GL_UNUSED ttyctl_t tty_control)
{
return fd_ostream_create (fd, filename, true);
}
static inline term_styled_ostream_t
term_styled_ostream_create (int fd, const char *filename,
- ttyctl_t tty_control _GL_UNUSED,
- const char *css_filename _GL_UNUSED)
+ _GL_UNUSED ttyctl_t tty_control,
+ _GL_UNUSED const char *css_filename)
{
return fd_ostream_create (fd, filename, true);
}
typedef styled_ostream_t html_styled_ostream_t;
static inline html_styled_ostream_t
-html_styled_ostream_create (ostream_t destination _GL_UNUSED,
- const char *css_filename _GL_UNUSED)
+html_styled_ostream_create (_GL_UNUSED ostream_t destination,
+ _GL_UNUSED const char *css_filename)
{
abort ();
return NULL;
#define style_file_name NULL
static inline bool
-handle_color_option (const char *option _GL_UNUSED)
+handle_color_option (_GL_UNUSED const char *option)
{
return false;
}
static inline void
-handle_style_option (const char *option _GL_UNUSED)
+handle_style_option (_GL_UNUSED const char *option)
{
}
}
static inline void
-style_file_prepare (const char *style_file_envvar _GL_UNUSED,
- const char *stylesdir_envvar _GL_UNUSED,
- const char *stylesdir_after_install _GL_UNUSED,
- const char *default_style_file _GL_UNUSED)
+style_file_prepare (_GL_UNUSED const char *style_file_envvar,
+ _GL_UNUSED const char *stylesdir_envvar,
+ _GL_UNUSED const char *stylesdir_after_install,
+ _GL_UNUSED const char *default_style_file)
{
}
static inline styled_ostream_t
styled_ostream_create (int fd, const char *filename,
- ttyctl_t tty_control _GL_UNUSED,
- const char *css_filename _GL_UNUSED)
+ _GL_UNUSED ttyctl_t tty_control,
+ _GL_UNUSED const char *css_filename)
{
return fd_ostream_create (fd, filename, true);
}
static inline void
-libtextstyle_set_failure_exit_code (int exit_code _GL_UNUSED)
+libtextstyle_set_failure_exit_code (_GL_UNUSED int exit_code)
{
}
/* Simple failure callback that displays an error and exits. */
static long
exit_failure_callback (unsigned int code, const char *msg,
- void *callback_arg _GL_UNUSED)
+ _GL_UNUSED void *callback_arg)
{
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 _GL_UNUSED,
+ _GL_UNUSED const char *msg,
void *callback_arg)
{
FILE *stream = (FILE *) callback_arg;
/* The cleanup action, taking a signal argument.
It gets called asynchronously. */
static _GL_ASYNC_SAFE void
-cleanup_slaves_action (int sig _GL_UNUSED)
+cleanup_slaves_action (_GL_UNUSED int sig)
{
cleanup_slaves ();
}
#else
# define _GL_ATTRIBUTE_MAYBE_UNUSED _GL_ATTRIBUTE_UNUSED
#endif
+/* Alternative spelling of this macro, for convenience. */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
/* Earlier spellings of this macro. */
#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
#else
# define _GL_ATTRIBUTE_UNUSED
#endif
-/* Alternative spelling of this macro, for convenience. */
-#define _GL_UNUSED _GL_ATTRIBUTE_UNUSED
]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
[
# define SIGNATURE_CHECK1(fn, ret, args, id) \
SIGNATURE_CHECK2 (fn, ret, args, id) /* macroexpand line */
# define SIGNATURE_CHECK2(fn, ret, args, id) \
- static ret (* _GL_UNUSED signature_check ## id) args = fn
+ _GL_UNUSED static ret (*signature_check ## id) args = fn
#endif /* SIGNATURE_CHECK */
/* Wrapper for testing areadlink. */
static char *
-do_areadlink (char const *name, size_t ignored _GL_UNUSED)
+do_areadlink (char const *name, _GL_UNUSED size_t ignored)
{
return areadlink (name);
}
/* Wrapper for testing areadlinkat. */
static char *
-do_areadlinkat (char const *name, size_t ignored _GL_UNUSED)
+do_areadlinkat (char const *name, _GL_UNUSED size_t ignored)
{
return areadlinkat (dfd, name);
}
}
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
float (*my_ceilf) (float) = argc ? ceilf : dummy;
}
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
float (*my_ceilf) (float) = argc ? ceilf : dummy;
#include <dirent.h>
/* Check for existence of required types. */
-static DIR *dir _GL_UNUSED;
+_GL_UNUSED static DIR *dir;
static struct dirent d;
static ino_t i;
}
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
int result1; /* Skip because of no chown/symlink support. */
int result2; /* Skip because of no lchown support. */
#include "macros.h"
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
DIR *d;
int fd;
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
static char const *const tests[][3] =
{
#include "macros.h"
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
/* Zero. */
ASSERT (floor (0.0) == 0.0);
}
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
float (*my_floorf) (float) = argc ? floorf : dummy;
}
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
float (*my_floorf) (float) = argc ? floorf : dummy;
#endif
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
/* Assume stdin is non-empty, seekable, and starts with '#!/bin/sh'
iff argc > 1. */
}
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
int result;
#endif
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
int ch;
/* Assume stdin is seekable iff argc > 1. */
#define NODOMAINNAME "magic-gnulib-test-string"
int
-main (int argc, char *argv[] _GL_UNUSED)
+main (int argc, _GL_UNUSED char *argv[])
{
char buf[YPMAXDOMAIN];
int rc;
#endif
int
-main (int argc, char **argv _GL_UNUSED)
+main (int argc, _GL_UNUSED char **argv)
{
int result;
gid_t *groups;
#define NOHOSTNAME "magic-gnulib-test-string"
int
-main (int argc, char *argv[] _GL_UNUSED)
+main (int argc, _GL_UNUSED char *argv[])
{
char buf[HOST_NAME_MAX];
int rc;
OVERLOADED_CHECK (func, rettype2, parameters2, _2); \
OVERLOADED_CHECK (func, rettype3, parameters3, _3)
#define OVERLOADED_CHECK(func, rettype, parameters, suffix) \
- static rettype (* _GL_UNUSED signature_check_ ## func ## suffix) parameters \
+ _GL_UNUSED static rettype (* signature_check_ ## func ## suffix) parameters \
= static_cast<rettype(*)parameters>(GNULIB_NAMESPACE::func)
}
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
int result;
}
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
int result;
}
int
-main (int argc _GL_UNUSED, char **argv)
+main (_GL_UNUSED int argc, char **argv)
{
struct timespec result;
struct timespec result2;
}
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
int i;
bool ascii_only = MB_CUR_MAX == 1 && !isprint ((unsigned char) LQ[0]);
#endif /* ENABLE_NLS */
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
#if ENABLE_NLS
/* Clean up environment. */
#endif
int
-main (int argc, char *argv[] _GL_UNUSED)
+main (int argc, _GL_UNUSED char *argv[])
{
char origname[HOST_NAME_MAX];
char newname[HOST_NAME_MAX];
}
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
/* FIXME: Add tests of fd other than ".". */
int result1;
#define AUTHORS "Sergey Poznyakoff", "Eric Blake"
int
-main (int argc _GL_UNUSED, char **argv)
+main (_GL_UNUSED int argc, char **argv)
{
version_etc (stdout, "test-version-etc", "dummy", "0", AUTHORS,
(const char *) NULL);
#include "xalloc.h"
int
-main (int argc _GL_UNUSED, char **argv)
+main (_GL_UNUSED int argc, char **argv)
{
xalloc_die ();
return 0;
#include "test-fprintf-posix.h"
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
test_function (xfprintf);
return 0;
#include "test-printf-posix.h"
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
test_function (xprintf);
return 0;
}
int
-main (int argc _GL_UNUSED, char *argv[])
+main (_GL_UNUSED int argc, char *argv[])
{
test_xvasprintf ();
test_xasprintf ();