From 5b96a5136aacc82a634d41407d4473494596f196 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 8 Mar 2022 18:46:47 -0800 Subject: [PATCH 1/2] Do not include from MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is because mod-test.c shouldn’t use source code from lib, but it does need to include . * 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 . * src/conf_post.h: Do not include . All uses of attribute.h macros replaced with their _GL_ equivalents. --- lib-src/ebrowse.c | 1 + lib-src/emacsclient.c | 1 + lib-src/etags.c | 1 + lib-src/make-docfile.c | 1 + lib-src/movemail.c | 1 + lib-src/seccomp-filter.c | 3 ++- src/conf_post.h | 19 +++++++++---------- src/dynlib.h | 1 + src/lisp.h | 1 + src/syssignal.h | 2 ++ src/sysstdio.h | 4 +++- src/systhread.h | 2 ++ src/tparam.h | 2 ++ 13 files changed, 27 insertions(+), 12 deletions(-) diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index ac7e790187..b77572734f 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -26,6 +26,7 @@ Copyright (C) 1992-2022 Free Software Foundation, Inc. #include #include +#include #include #include #include diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 365e803e1c..7406ef3490 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -80,6 +80,7 @@ Copyright (C) 1986-1987, 1994, 1999-2022 Free Software Foundation, Inc. #include #include +#include #include #include #include diff --git a/lib-src/etags.c b/lib-src/etags.c index aa5bc8839d..65b9fae8d5 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -112,6 +112,7 @@ Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2022 Free Software # define O_CLOEXEC O_NOINHERIT #endif /* WINDOWSNT */ +#include #include #include #include diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index f42b1988a2..d2d4b1d277 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -42,6 +42,7 @@ Copyright (C) 1985-1986, 1992-1994, 1997, 1999-2022 Free Software #include #include +#include #include #include #include diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 888688f90b..aa3c15e72e 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -69,6 +69,7 @@ Copyright (C) 1986, 1992-1994, 1996, 1999, 2001-2022 Free Software #include #include +#include #include #include "syswait.h" diff --git a/lib-src/seccomp-filter.c b/lib-src/seccomp-filter.c index b515851010..9f0de7d64f 100644 --- a/lib-src/seccomp-filter.c +++ b/lib-src/seccomp-filter.c @@ -59,7 +59,8 @@ Copyright (C) 2020-2022 Free Software Foundation, Inc. #include #include -#include "verify.h" +#include +#include #ifndef ARCH_CET_STATUS #define ARCH_CET_STATUS 0x3001 diff --git a/src/conf_post.h b/src/conf_post.h index dd350b8dc8..5108e44efb 100644 --- a/src/conf_post.h +++ b/src/conf_post.h @@ -32,13 +32,11 @@ Copyright (C) 1988, 1993-1994, 1999-2002, 2004-2022 Free Software /* 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 -#include #if defined WINDOWSNT && !defined DEFER_MS_W32_H # include @@ -279,8 +277,8 @@ #define setenv_TZ emacs_setenv_TZ 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 @@ #define EXTERNALLY_VISIBLE ATTRIBUTE_EXTERNALLY_VISIBLE # 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 @@ #define ARG_NONNULL ATTRIBUTE_NONNULL 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 diff --git a/src/dynlib.h b/src/dynlib.h index ac3d8e58ab..03b8f98356 100644 --- a/src/dynlib.h +++ b/src/dynlib.h @@ -20,6 +20,7 @@ #ifndef DYNLIB_H #define DYNLIB_H +#include #include typedef void *dynlib_handle_ptr; diff --git a/src/lisp.h b/src/lisp.h index deeca9bc86..778bd1bfa5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -31,6 +31,7 @@ #define EMACS_LISP_H #include #include +#include #include #include diff --git a/src/syssignal.h b/src/syssignal.h index 07055c04be..02fe44a382 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -22,6 +22,8 @@ #define EMACS_SYSSIGNAL_H #include +#include + extern void init_signals (void); extern void block_child_signal (sigset_t *); extern void unblock_child_signal (sigset_t const *); diff --git a/src/sysstdio.h b/src/sysstdio.h index 5bcfe7d8a5..727a466be5 100644 --- a/src/sysstdio.h +++ b/src/sysstdio.h @@ -24,7 +24,9 @@ #define EMACS_SYSSTDIO_H #include #include #include -#include "unlocked-io.h" + +#include +#include extern FILE *emacs_fopen (char const *, char const *) ATTRIBUTE_MALLOC; extern void errputc (int); diff --git a/src/systhread.h b/src/systhread.h index fb1a0a72d6..bf4e0306cd 100644 --- a/src/systhread.h +++ b/src/systhread.h @@ -21,6 +21,8 @@ #define SYSTHREAD_H #include +#include + #ifdef THREADS_ENABLED #ifdef HAVE_PTHREAD diff --git a/src/tparam.h b/src/tparam.h index 6361f138ea..653f01bdde 100644 --- a/src/tparam.h +++ b/src/tparam.h @@ -20,6 +20,8 @@ Copyright (C) 2011-2022 Free Software Foundation, Inc. #ifndef EMACS_TPARAM_H #define EMACS_TPARAM_H +#include + /* Don't try to include termcap.h. On some systems, configure finds a non-standard termcap.h that the main build won't find. */ -- 2.35.1