emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 d00f3d4: Port unused decls to C2x


From: Paul Eggert
Subject: emacs-28 d00f3d4: Port unused decls to C2x
Date: Sun, 3 Oct 2021 23:05:14 -0400 (EDT)

branch: emacs-28
commit d00f3d4c05713254b3fec19601f6944442b956ff
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    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.
---
 src/conf_post.h | 1 -
 src/process.c   | 2 +-
 src/unexcw.c    | 6 +++---
 src/xterm.c     | 2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/conf_post.h b/src/conf_post.h
index 8558dc4..2c6fbb0 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 58347a1..221d4c7 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 7a80b05..157e9f4 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 ae3af59..cf1e97a 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)
 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]