Consolidate error.h inclusion in system.h

error.h isn't standard and so isn't part of the musl C library.
To easy future porting, consolidate the inclusion of error.h into system.h.

https://sourceware.org/bugzilla/show_bug.cgi?id=21008

Signed-off-by: Ross Burton <ross.burton@intel.com>
This commit is contained in:
Ross Burton
2018-07-04 12:11:08 +01:00
committed by Mark Wielaard
parent d612684109
commit e893aab0d1
67 changed files with 116 additions and 63 deletions
+6
View File
@@ -1,3 +1,9 @@
2018-07-04 Ross Burton <ross.burton@intel.com>
* color.c: Remove error.h, add system.h include.
* system.h: Add error.h include.
* xmalloc.c: Remove error.h include.
2018-06-01 Mark Wielaard <mark@klomp.org>
* printversion.c (print_version): Update copyright year.
+1 -1
View File
@@ -32,11 +32,11 @@
#endif
#include <argp.h>
#include <error.h>
#include <libintl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "system.h"
#include "libeu.h"
#include "color.h"
+1
View File
@@ -30,6 +30,7 @@
#define LIB_SYSTEM_H 1
#include <errno.h>
#include <error.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/param.h>
-1
View File
@@ -30,7 +30,6 @@
# include <config.h>
#endif
#include <error.h>
#include <libintl.h>
#include <stddef.h>
#include <stdlib.h>
+8
View File
@@ -1,3 +1,11 @@
2018-07-04 Ross Burton <ross.burton@intel.com>
* asm_end.c: Remove error.h include.
* asm_newscn.c: Likewise.
* i386_gendis.c: Likewise and add system.h include.
* i386_lex.l: Likewise.
* i386_parse.y: Likewise.
2017-02-27 Ulf Hermann <ulf.hermann@qt.io>
* Makefile.am: Use dso_LDFLAGS.
-1
View File
@@ -32,7 +32,6 @@
#endif
#include <assert.h>
#include <error.h>
#include <libintl.h>
#include <stdio.h>
#include <stdlib.h>
-1
View File
@@ -32,7 +32,6 @@
#endif
#include <assert.h>
#include <error.h>
#include <libintl.h>
#include <stdlib.h>
#include <string.h>
+1 -2
View File
@@ -31,12 +31,11 @@
# include <config.h>
#endif
#include <error.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "system.h"
extern int i386_parse (void);
+1 -1
View File
@@ -31,10 +31,10 @@
#endif
#include <ctype.h>
#include <error.h>
#include <libintl.h>
#include <libeu.h>
#include "system.h"
#include "i386_parse.h"
-1
View File
@@ -34,7 +34,6 @@
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <error.h>
#include <inttypes.h>
#include <libintl.h>
#include <math.h>
+4
View File
@@ -1,3 +1,7 @@
2018-07-04 Ross Burton <ross.burton@intel.com>
* libdw_alloc.c: Remove error.h include.
2018-06-28 Mark Wielaard <mark@klomp.org>
* dwarf_next_cfi.c (dwarf_next_cfi): Check whether length is zero.
-1
View File
@@ -31,7 +31,6 @@
# include <config.h>
#endif
#include <error.h>
#include <errno.h>
#include <stdlib.h>
#include "libdwP.h"
+4
View File
@@ -1,3 +1,7 @@
2018-07-04 Ross Burton <ross.burton@intel.com>
* eblopenbackend.c: Remove error.h include.
2018-04-25 Mark Wielaard <mark@klomp.org>
* eblopenbackend.c (default_debugscn_p): Add new DWARF5 sections
-1
View File
@@ -32,7 +32,6 @@
#include <assert.h>
#include <dlfcn.h>
#include <error.h>
#include <libelfP.h>
#include <dwarf.h>
#include <stdlib.h>
+19
View File
@@ -1,3 +1,22 @@
2018-07-04 Ross Burton <ross.burton@intel.com>
* addr2line.c: Remove error.h include.
* ar.c: Likewise.
* arlib.c: Likewise and add system.h include.
* arlib2.c: Likewise.
* elfcmp.c: Likewise.
* elfcompress.c: Likewise.
* elflint.c: Likewise.
* findtextrel.c: Likewise.
* nm.c: Likewise.
* objdump.c: Likewise.
* ranlib.c: Likewise.
* readelf.c: Likewise.
* stack.c: Likewise.
* strings.c: Likewise.
* strip.c: Likewise.
* unstrip.c: Likewise.
2018-06-25 Mark Wielaard <mark@klomp.org>
* readelf.c (print_decoded_line_section): Use dwarf_next_lines
-1
View File
@@ -23,7 +23,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libdwfl.h>
-1
View File
@@ -22,7 +22,6 @@
#include <argp.h>
#include <assert.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <libintl.h>
+1 -1
View File
@@ -21,7 +21,6 @@
#endif
#include <assert.h>
#include <error.h>
#include <gelf.h>
#include <inttypes.h>
#include <libintl.h>
@@ -31,6 +30,7 @@
#include <libeu.h>
#include "system.h"
#include "arlib.h"
-1
View File
@@ -20,7 +20,6 @@
# include <config.h>
#endif
#include <error.h>
#include <libintl.h>
#include <limits.h>
#include <string.h>
+1 -2
View File
@@ -23,7 +23,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <locale.h>
#include <libintl.h>
@@ -36,7 +35,7 @@
#include <printversion.h>
#include "../libelf/elf-knowledge.h"
#include "../libebl/libeblP.h"
#include "system.h"
/* Prototypes of local functions. */
static Elf *open_file (const char *fname, int *fdp, Ebl **eblp);
+1 -1
View File
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <argp.h>
#include <error.h>
#include <stdbool.h>
#include <stdlib.h>
#include <inttypes.h>
@@ -34,6 +33,7 @@
#include ELFUTILS_HEADER(ebl)
#include ELFUTILS_HEADER(dwelf)
#include <gelf.h>
#include "system.h"
#include "libeu.h"
#include "printversion.h"
-1
View File
@@ -24,7 +24,6 @@
#include <assert.h>
#include <byteswap.h>
#include <endian.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
+1 -2
View File
@@ -23,7 +23,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <libdw.h>
@@ -37,7 +36,7 @@
#include <unistd.h>
#include <printversion.h>
#include "system.h"
struct segments
{
-1
View File
@@ -26,7 +26,6 @@
#include <ctype.h>
#include <dwarf.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
-1
View File
@@ -21,7 +21,6 @@
#endif
#include <argp.h>
#include <error.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libintl.h>
-1
View File
@@ -24,7 +24,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <libintl.h>
-1
View File
@@ -24,7 +24,6 @@
#include <ctype.h>
#include <dwarf.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
-1
View File
@@ -21,7 +21,6 @@
#endif
#include <argp.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
-1
View File
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <argp.h>
#include <error.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdio.h>
-1
View File
@@ -25,7 +25,6 @@
#include <ctype.h>
#include <endian.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
-1
View File
@@ -24,7 +24,6 @@
#include <assert.h>
#include <byteswap.h>
#include <endian.h>
#include <error.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <gelf.h>
+1 -1
View File
@@ -31,7 +31,6 @@
#include <argp.h>
#include <assert.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <fnmatch.h>
#include <libintl.h>
@@ -48,6 +47,7 @@
#include <gelf.h>
#include <libebl.h>
#include <libdwfl.h>
#include "system.h"
#include "libdwelf.h"
#include "libeu.h"
#include "printversion.h"
+37
View File
@@ -1,3 +1,40 @@
2018-07-04 Ross Burton <ross.burton@intel.com>
* addrscopes.c: Remove error.h include, add system.h include.
* allregs.c: Likewise.
* backtrace-data.c: Likewise.
* backtrace-dwarf.c: Likewise.
* backtrace.c: Likewise.
* buildid.c: Likewise.
* debugaltlink.c: Likewise.
* debuglink.c: Likewise.
* deleted.c : Likewise.
* dwarfcfi.c: Likewise.
* dwfl-addr-sect.c: Likewise.
* dwfl-bug-addr-overflow.c: Likewise.
* dwfl-bug-fd-leak.c: Likewise.
* dwfl-bug-getmodules.c: Likewise.
* dwfl-proc-attach.c: Likewise.
* dwfl-report-elf-align.c: Likewise.
* dwfllines.c: Likewise.
* dwflmodtest.c: Likewise.
* dwflsyms.c: Likewise.
* early-offscn.c: Likewise
* ecp.c: Likewise.
* elfstrmerge.c: Likewise.
* find-prologues.c: Likewise.
* funcretval.c: Likewise.
* funcscopes.c: Likewise.
* getsrc_die.c: Likewise.
* line2addr.c: Likewise.
* low_high_pc.c: Likewise.
* next_cfi.c: Likewise.
* rdwrmmap.c: Likewise.
* saridx.c: Likewise.
* sectiondump.c: Likewise.
* varlocs.c: Likewise.
* vdsosyms.c: Likewise.
2018-06-28 Mark Wielaard <mark@klomp.org>
* next_cfi.c: New file.
+1 -1
View File
@@ -25,8 +25,8 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
#include "system.h"
static void
+1 -1
View File
@@ -21,13 +21,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
#include <locale.h>
#include <argp.h>
#include <assert.h>
#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
#include "system.h"
#include "../libdw/known-dwarf.h"
static const char *
+1 -1
View File
@@ -27,7 +27,6 @@
#include <dirent.h>
#include <stdlib.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
#include <dwarf.h>
#if defined(__x86_64__) && defined(__linux__)
@@ -41,6 +40,7 @@
#include <string.h>
#include ELFUTILS_HEADER(dwfl)
#endif
#include "system.h"
#if !defined(__x86_64__) || !defined(__linux__)
+1 -1
View File
@@ -21,10 +21,10 @@
#include <stdio_ext.h>
#include <locale.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
#include <sys/types.h>
#include ELFUTILS_HEADER(dwfl)
#include "system.h"
#ifndef __linux__
+1 -1
View File
@@ -24,7 +24,6 @@
#include <dirent.h>
#include <stdlib.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
#include <dwarf.h>
#ifdef __linux__
@@ -39,6 +38,7 @@
#include <argp.h>
#include ELFUTILS_HEADER(dwfl)
#endif
#include "system.h"
#ifndef __linux__
+1 -1
View File
@@ -23,13 +23,13 @@
#include ELFUTILS_HEADER(elf)
#include ELFUTILS_HEADER(dwelf)
#include <stdio.h>
#include <error.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "system.h"
int
main (int argc, char *argv[])
+1 -1
View File
@@ -23,13 +23,13 @@
#include ELFUTILS_HEADER(dw)
#include ELFUTILS_HEADER(dwelf)
#include <stdio.h>
#include <error.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "system.h"
int
main (int argc, char *argv[])
+1 -1
View File
@@ -21,13 +21,13 @@
#include <errno.h>
#include ELFUTILS_HEADER(dwelf)
#include <stdio.h>
#include <error.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "system.h"
int
main (int argc, char *argv[])
-1
View File
@@ -21,7 +21,6 @@
#include <unistd.h>
#include <assert.h>
#include <stdio.h>
#include <error.h>
#include <errno.h>
#ifdef __linux__
#include <sys/prctl.h>
+1 -1
View File
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <inttypes.h>
#include <error.h>
#include ELFUTILS_HEADER(dw)
#include <dwarf.h>
#include <argp.h>
@@ -30,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include "system.h"
#include "../libdw/known-dwarf.h"
static const char *
+1 -1
View File
@@ -23,11 +23,11 @@
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
#include <locale.h>
#include <argp.h>
#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
#include "system.h"
static int
handle_address (Dwfl *dwfl, Dwarf_Addr address)
-1
View File
@@ -20,7 +20,6 @@
#include <inttypes.h>
#include <stdio.h>
#include <stdio_ext.h>
#include <error.h>
#include <locale.h>
#include ELFUTILS_HEADER(dwfl)
+1 -1
View File
@@ -24,9 +24,9 @@
#include <dirent.h>
#include <stdlib.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
#include <dwarf.h>
#include "system.h"
#ifndef __linux__
int
+1 -1
View File
@@ -17,8 +17,8 @@
#include <config.h>
#include ELFUTILS_HEADER(dwfl)
#include "system.h"
#include <error.h>
static const Dwfl_Callbacks callbacks =
{
+1 -1
View File
@@ -20,7 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <error.h>
#include <unistd.h>
#ifdef __linux__
#include <sys/types.h>
@@ -31,6 +30,7 @@
#include ELFUTILS_HEADER(dwfl)
#include <pthread.h>
#endif
#include "system.h"
#ifndef __linux__
int
+1 -1
View File
@@ -20,11 +20,11 @@
#include <inttypes.h>
#include <stdio.h>
#include <stdio_ext.h>
#include <error.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include ELFUTILS_HEADER(dwfl)
#include "system.h"
static const Dwfl_Callbacks offline_callbacks =
+1 -1
View File
@@ -27,7 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
#include "system.h"
int
main (int argc, char *argv[])
+1 -1
View File
@@ -23,11 +23,11 @@
#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
#include <locale.h>
#include <argp.h>
#include ELFUTILS_HEADER(dwfl)
#include <dwarf.h>
#include "system.h"
static bool show_inlines;
-1
View File
@@ -25,7 +25,6 @@
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
static const char *
+1 -1
View File
@@ -19,11 +19,11 @@
#endif
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <stdio.h>
#include <stdlib.h>
#include "system.h"
int
main (int argc, char *argv[])
+1 -1
View File
@@ -20,11 +20,11 @@
#endif
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <stdlib.h>
#include <unistd.h>
#include "system.h"
int
main (int argc, char *argv[])
-1
View File
@@ -24,7 +24,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <error.h>
#include <stdio.h>
#include <inttypes.h>
#include <unistd.h>
+1 -1
View File
@@ -25,9 +25,9 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
#include <fnmatch.h>
#include "system.h"
struct args
+1 -1
View File
@@ -25,9 +25,9 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
#include <fnmatch.h>
#include "system.h"
struct args
+1 -1
View File
@@ -25,9 +25,9 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
#include <fnmatch.h>
#include "system.h"
static void
+1 -1
View File
@@ -19,7 +19,6 @@
#endif
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <inttypes.h>
#include <libelf.h>
@@ -27,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "system.h"
int
+1 -1
View File
@@ -26,7 +26,7 @@
#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
#include "system.h"
static void
-1
View File
@@ -25,7 +25,6 @@
#include <stdio_ext.h>
#include <locale.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
#include <fnmatch.h>
+1 -1
View File
@@ -18,7 +18,6 @@
#include <config.h>
#include <assert.h>
#include <inttypes.h>
#include <error.h>
#include ELFUTILS_HEADER(dw)
#include <dwarf.h>
#include <argp.h>
@@ -31,6 +30,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "system.h"
void
handle_section (const unsigned char e_ident[],
+1 -1
View File
@@ -19,11 +19,11 @@
#endif
#include <errno.h>
#include <error.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <libelf.h>
#include "system.h"
int
main (int argc __attribute__ ((unused)), char *argv[])
+1 -1
View File
@@ -17,7 +17,6 @@
#include <config.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <stdio.h>
@@ -25,6 +24,7 @@
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "system.h"
static const char *machines[] =
+1 -1
View File
@@ -18,13 +18,13 @@
#include <config.h>
#include <errno.h>
#include <error.h>
#include <fcntl.h>
#include <gelf.h>
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "system.h"
/* Prototypes for local functions. */
+1 -1
View File
@@ -25,13 +25,13 @@
#include <dwarf.h>
#include <stdio.h>
#include <stdlib.h>
#include <error.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "system.h"
#include "../libdw/known-dwarf.h"
// The Dwarf, Dwarf_CFIs and address bias of
+1 -1
View File
@@ -18,13 +18,13 @@
#include <config.h>
#include <assert.h>
#include <errno.h>
#include <error.h>
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include ELFUTILS_HEADER(dwfl)
#include "system.h"
#ifndef __linux__
int