From: Paul Eggert Date: Mon, 4 Oct 2021 03:04:09 +0000 (-0700) Subject: Port unused decls to C2x X-Git-Tag: emacs-28.0.90~424 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d00f3d4c05713254b3fec19601f6944442b956ff;p=emacs.git Port unused decls to C2x * src/conf_post.h (ATTRIBUTE_UNUSED): Remove. All uses replaced by MAYBE_UNUSED, and moved to start as needed for C2x. --- diff --git a/src/conf_post.h b/src/conf_post.h index 8558dc466cc..2c6fbb0dba5 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -293,7 +293,6 @@ extern int emacs_setenv_TZ (char const *); ATTRIBUTE_FORMAT ((PRINTF_ARCHETYPE, string_index, first_to_check)) #define ARG_NONNULL ATTRIBUTE_NONNULL -#define ATTRIBUTE_UNUSED MAYBE_UNUSED /* Declare NAME to be a pointer to an object of type TYPE, initialized to the address ADDR, which may be of a different type. Accesses diff --git a/src/process.c b/src/process.c index 58347a154a3..221d4c7f6c3 100644 --- a/src/process.c +++ b/src/process.c @@ -4004,7 +4004,7 @@ usage: (make-network-process &rest ARGS) */) if (!NILP (host)) { - ptrdiff_t portstringlen ATTRIBUTE_UNUSED; + MAYBE_UNUSED ptrdiff_t portstringlen; /* SERVICE can either be a string or int. Convert to a C string for later use by getaddrinfo. */ diff --git a/src/unexcw.c b/src/unexcw.c index 7a80b05963b..157e9f45607 100644 --- a/src/unexcw.c +++ b/src/unexcw.c @@ -48,7 +48,7 @@ static exe_header_t * read_exe_header (int fd, exe_header_t * exe_header_buffer) { int i; - int ret ATTRIBUTE_UNUSED; + MAYBE_UNUSED int ret; assert (fd >= 0); assert (exe_header_buffer != 0); @@ -111,7 +111,7 @@ fixup_executable (int fd) exe_header_t exe_header_buffer; exe_header_t *exe_header; int i; - int ret ATTRIBUTE_UNUSED; + MAYBE_UNUSED int ret; int found_data = 0; int found_bss = 0; @@ -269,7 +269,7 @@ unexec (const char *outfile, const char *infile) int fd_in; int fd_out; int ret; - int ret2 ATTRIBUTE_UNUSED; + MAYBE_UNUSED int ret2; infile = add_exe_suffix_if_necessary (infile, infile_buffer); outfile = add_exe_suffix_if_necessary (outfile, outfile_buffer); diff --git a/src/xterm.c b/src/xterm.c index ae3af598da6..cf1e97a8b93 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -4049,7 +4049,7 @@ x_delete_glyphs (struct frame *f, int n) /* Like XClearArea, but check that WIDTH and HEIGHT are reasonable. If they are <= 0, this is probably an error. */ -static ATTRIBUTE_UNUSED void +MAYBE_UNUSED static void x_clear_area1 (Display *dpy, Window window, int x, int y, int width, int height, int exposures) {