aboutsummaryrefslogtreecommitdiff
path: root/sim/igen
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-01-09 03:56:10 -0500
committerMike Frysinger <vapier@gentoo.org>2021-01-11 08:05:54 -0500
commit68ed2854284d415a71efd856a40343f550881ede (patch)
treef00f87cc7628c8e82de418bacc5d941db46c2481 /sim/igen
parenta8aa72b913e78407e5de4fefd22f9b98e4466f30 (diff)
downloadfsf-binutils-gdb-68ed2854284d415a71efd856a40343f550881ede.zip
fsf-binutils-gdb-68ed2854284d415a71efd856a40343f550881ede.tar.gz
fsf-binutils-gdb-68ed2854284d415a71efd856a40343f550881ede.tar.bz2
sim: clean up C11 header includes
Since we require C11 now, we can assume many headers exist, and clean up all of the conditional includes. It's not like any of this code actually accounted for the headers not existing, just whether we could include them. The strings.h cleanup is a little nuanced: it isn't in C11, but every use of it in the codebase will include strings.h only if string.h doesn't exist. Since we now assume the C11 string.h exists, we'll never include strings.h, so we can delete it.
Diffstat (limited to 'sim/igen')
-rw-r--r--sim/igen/ChangeLog11
-rwxr-xr-xsim/igen/configure3
-rw-r--r--sim/igen/configure.ac3
-rw-r--r--sim/igen/filter.c6
-rw-r--r--sim/igen/lf.c9
-rw-r--r--sim/igen/misc.c9
-rw-r--r--sim/igen/misc.h10
-rw-r--r--sim/igen/table.c3
8 files changed, 15 insertions, 39 deletions
diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog
index 7f9e87a..25a2c33 100644
--- a/sim/igen/ChangeLog
+++ b/sim/igen/ChangeLog
@@ -1,3 +1,14 @@
+2021-01-11 Mike Frysinger <vapier@gentoo.org>
+
+ * configure.ac (AC_CHECK_HEADERS): Delete stdlib.h, string.h, and
+ strings.h.
+ * configure, configure.ac: Regenerate.
+
+2021-01-11 Mike Frysinger <vapier@gentoo.org>
+
+ * filter.c, if.c, misc.c, misc.h, table.c: Delete HAVE_STRING_H,
+ HAVE_STRINGS_H, HAVE_STDLIB_H, and strings.h include.
+
2021-01-09 Mike Frysinger <vapier@gentoo.org>
* configure: Regenerate.
diff --git a/sim/igen/configure b/sim/igen/configure
index a6df60c..877a23d 100755
--- a/sim/igen/configure
+++ b/sim/igen/configure
@@ -5028,6 +5028,7 @@ program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
ac_config_headers="$ac_config_headers config.h:config.in"
+# NB: You can assume C11 headers exist.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -5425,7 +5426,7 @@ fi
done
-for ac_header in stdlib.h string.h strings.h sys/stat.h sys/types.h unistd.h
+for ac_header in sys/stat.h sys/types.h unistd.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/sim/igen/configure.ac b/sim/igen/configure.ac
index f03d8b7..12536c2 100644
--- a/sim/igen/configure.ac
+++ b/sim/igen/configure.ac
@@ -32,7 +32,8 @@ AC_ARG_PROGRAM
AC_CONFIG_HEADER(config.h:config.in)
-AC_CHECK_HEADERS(stdlib.h string.h strings.h sys/stat.h sys/types.h unistd.h)
+# NB: You can assume C11 headers exist.
+AC_CHECK_HEADERS(sys/stat.h sys/types.h unistd.h)
AC_HEADER_DIRENT
AC_SUBST(AR_FOR_BUILD)
diff --git a/sim/igen/filter.c b/sim/igen/filter.c
index 8059e00..e37d680 100644
--- a/sim/igen/filter.c
+++ b/sim/igen/filter.c
@@ -24,13 +24,7 @@
#include "config.h"
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
#include "misc.h"
#include "lf.h"
diff --git a/sim/igen/lf.c b/sim/igen/lf.c
index e8bf75c..4a7978e 100644
--- a/sim/igen/lf.c
+++ b/sim/igen/lf.c
@@ -29,17 +29,8 @@
#include "misc.h"
#include "lf.h"
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
struct _lf
{
diff --git a/sim/igen/misc.c b/sim/igen/misc.c
index 1678bfc..d74f74e 100644
--- a/sim/igen/misc.c
+++ b/sim/igen/misc.c
@@ -28,17 +28,8 @@
#include "config.h"
#include "misc.h"
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
-
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
/* NB: Because warning and error can be interchanged, neither append a
trailing '\n' */
diff --git a/sim/igen/misc.h b/sim/igen/misc.h
index 7634816..40e9cd0 100644
--- a/sim/igen/misc.h
+++ b/sim/igen/misc.h
@@ -54,18 +54,8 @@ typedef unsigned __int64 unsigned64;
#include <stdio.h>
#include <ctype.h>
-
-#ifdef HAVE_STRING_H
#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
#if !defined (__attribute__) && (!defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
#define __attribute__(arg)
diff --git a/sim/igen/table.c b/sim/igen/table.c
index 5b0d07e..d21b282 100644
--- a/sim/igen/table.c
+++ b/sim/igen/table.c
@@ -35,10 +35,7 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-
-#ifdef HAVE_STDLIB_H
#include <stdlib.h>
-#endif
typedef struct _open_table open_table;
struct _open_table