]> git.eshelyaron.com Git - emacs.git/commitdiff
Do not include <attribute.h> from <config.h>
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 9 Mar 2022 02:46:47 +0000 (18:46 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 9 Mar 2022 02:51:17 +0000 (18:51 -0800)
This is because mod-test.c shouldn’t use source code from lib,
but it does need to include <config.h>.
* lib-src/ebrowse.c, lib-src/emacsclient.c, lib-src/etags.c:
* lib-src/make-docfile.c, lib-src/movemail.c:
* lib-src/seccomp-filter.c, src/dynlib.h, src/lisp.h:
* src/syssignal.h, src/sysstdio.h, src/systhread.h, src/tparam.h:
Include <attribute.h>.
* src/conf_post.h: Do not include <attribute.h>.
All uses of attribute.h macros replaced with their _GL_ equivalents.

13 files changed:
lib-src/ebrowse.c
lib-src/emacsclient.c
lib-src/etags.c
lib-src/make-docfile.c
lib-src/movemail.c
lib-src/seccomp-filter.c
src/conf_post.h
src/dynlib.h
src/lisp.h
src/syssignal.h
src/sysstdio.h
src/systhread.h
src/tparam.h

index ac7e790187814c12b00267bb5265447f51585b25..b77572734fe1fe405e51f7fc200e45277678bece 100644 (file)
@@ -26,6 +26,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <assert.h>
 #include <getopt.h>
 
+#include <attribute.h>
 #include <flexmember.h>
 #include <min-max.h>
 #include <unlocked-io.h>
index 365e803e1cd4fcb75f2c15aad73d58437faa9e60..7406ef3490ebb2227c039d984e28a2cc98fb9e40 100644 (file)
@@ -80,6 +80,7 @@ char *w32_getenv (const char *);
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include <attribute.h>
 #include <filename.h>
 #include <intprops.h>
 #include <min-max.h>
index aa5bc8839dda2b2568b7aa09396ad111b259e065..65b9fae8d5a999cd9cb964162c1317748d43a792 100644 (file)
@@ -112,6 +112,7 @@ University of California, as described above. */
 # define O_CLOEXEC O_NOINHERIT
 #endif /* WINDOWSNT */
 
+#include <attribute.h>
 #include <inttypes.h>
 #include <limits.h>
 #include <unistd.h>
index f42b1988a2b7a95019c6c8b7d203d132ad19ea5f..d2d4b1d2778d5c849aa10139656c9951bc6bb11a 100644 (file)
@@ -42,6 +42,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <stdlib.h>
 #include <string.h>
 
+#include <attribute.h>
 #include <binary-io.h>
 #include <c-ctype.h>
 #include <intprops.h>
index 888688f90b1c7fe2f5e00102fc01260ad14143a1..aa3c15e72e8507e25d1e838054f3a425b5cc6e93 100644 (file)
@@ -69,6 +69,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <signal.h>
 #include <string.h>
 
+#include <attribute.h>
 #include <unlocked-io.h>
 
 #include "syswait.h"
index b51585101044bc5ea9a8f5b7c6d2c95a3e7116d0..9f0de7d64f83e432607aa1701478a919606ed02f 100644 (file)
@@ -59,7 +59,8 @@ variants of those files that can be used to sandbox Emacs before
 #include <seccomp.h>
 #include <unistd.h>
 
-#include "verify.h"
+#include <attribute.h>
+#include <verify.h>
 
 #ifndef ARCH_CET_STATUS
 #define ARCH_CET_STATUS 0x3001
index dd350b8dc83d5368e7e1b9211863ce2375a66523..5108e44efbd0c893a0f046fa0075b67a440d69af 100644 (file)
@@ -32,13 +32,11 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 /* To help make dependencies clearer elsewhere, this file typically
    does not #include other files.  The exceptions are stdbool.h
    because it is unlikely to interfere with configuration and bool is
-   such a core part of the C language, attribute.h because its
-   ATTRIBUTE_* macros are used here, and ms-w32.h (DOS_NT
+   such a core part of the C language, and ms-w32.h (DOS_NT
    only) because it historically was included here and changing that
    would take some work.  */
 
 #include <stdbool.h>
-#include <attribute.h>
 
 #if defined WINDOWSNT && !defined DEFER_MS_W32_H
 # include <ms-w32.h>
@@ -279,8 +277,8 @@ extern void _DebPrint (const char *fmt, ...);
 extern char *emacs_getenv_TZ (void);
 extern int emacs_setenv_TZ (char const *);
 
-#define NO_INLINE ATTRIBUTE_NOINLINE
-#define EXTERNALLY_VISIBLE ATTRIBUTE_EXTERNALLY_VISIBLE
+#define NO_INLINE _GL_ATTRIBUTE_NOINLINE
+#define EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
 
 #if GNUC_PREREQ (4, 4, 0) && defined __GLIBC_MINOR__
 # define PRINTF_ARCHETYPE __gnu_printf__
@@ -310,9 +308,9 @@ extern int emacs_setenv_TZ (char const *);
 # define PRINTF_ARCHETYPE __printf__
 #endif
 #define ATTRIBUTE_FORMAT_PRINTF(string_index, first_to_check) \
-  ATTRIBUTE_FORMAT ((PRINTF_ARCHETYPE, string_index, first_to_check))
+  _GL_ATTRIBUTE_FORMAT ((PRINTF_ARCHETYPE, string_index, first_to_check))
 
-#define ARG_NONNULL ATTRIBUTE_NONNULL
+#define ARG_NONNULL _GL_ATTRIBUTE_NONNULL
 
 /* 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
@@ -320,15 +318,16 @@ extern int emacs_setenv_TZ (char const *);
    behavior, even if options like gcc -fstrict-aliasing are used.  */
 
 #define DECLARE_POINTER_ALIAS(name, type, addr) \
-  type ATTRIBUTE_MAY_ALIAS *name = (type *) (addr)
+  type _GL_ATTRIBUTE_MAY_ALIAS *name = (type *) (addr)
 
 #if 3 <= __GNUC__
 # define ATTRIBUTE_SECTION(name) __attribute__((section (name)))
 #else
-#define ATTRIBUTE_SECTION(name)
+# define ATTRIBUTE_SECTION(name)
 #endif
 
-#define ATTRIBUTE_MALLOC_SIZE(args) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE (args)
+#define ATTRIBUTE_MALLOC_SIZE(args) \
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE (args)
 
 /* Work around GCC bug 59600: when a function is inlined, the inlined
    code may have its addresses sanitized even if the function has the
index ac3d8e58ab330ea944836569f3cfeefba8646b95..03b8f983564fe43c00defc1695027fd72f1b3709 100644 (file)
@@ -20,6 +20,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #ifndef DYNLIB_H
 #define DYNLIB_H
 
+#include <attribute.h>
 #include <stdbool.h>
 
 typedef void *dynlib_handle_ptr;
index deeca9bc86b549695d4400d35b50e9f95e6463a3..778bd1bfa5a30c2cd3f4de03b101da765a5fc261 100644 (file)
@@ -31,6 +31,7 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <inttypes.h>
 #include <limits.h>
 
+#include <attribute.h>
 #include <intprops.h>
 #include <verify.h>
 
index 07055c04be626c4044cacea0ccbd6d6d7078b65e..02fe44a3820382611803b632d6c89527a7a214f5 100644 (file)
@@ -22,6 +22,8 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <signal.h>
 
+#include <attribute.h>
+
 extern void init_signals (void);
 extern void block_child_signal (sigset_t *);
 extern void unblock_child_signal (sigset_t const *);
index 5bcfe7d8a58c87ff71d53cb7b407577855faed61..727a466be527a7073258ad1e7f41674d70315511 100644 (file)
@@ -24,7 +24,9 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #include <fcntl.h>
 #include <limits.h>
 #include <stdio.h>
-#include "unlocked-io.h"
+
+#include <attribute.h>
+#include <unlocked-io.h>
 
 extern FILE *emacs_fopen (char const *, char const *) ATTRIBUTE_MALLOC;
 extern void errputc (int);
index fb1a0a72d6406e1a429eb7f962091eba1c3ce646..bf4e0306cdca2927cc2c5071f42f866c0489c490 100644 (file)
@@ -21,6 +21,8 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <stdbool.h>
 
+#include <attribute.h>
+
 #ifdef THREADS_ENABLED
 
 #ifdef HAVE_PTHREAD
index 6361f138eaa2d69d6877310cdbf3e629f81728c2..653f01bdde0d04c54051d588642a38126513e31a 100644 (file)
@@ -20,6 +20,8 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #ifndef EMACS_TPARAM_H
 #define EMACS_TPARAM_H
 
+#include <attribute.h>
+
 /* Don't try to include termcap.h.  On some systems, configure finds a
    non-standard termcap.h that the main build won't find.  */