From 3d52735bab7e6df662381f51ee00b10e170cd6e9 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 4 Jan 2021 20:17:37 -0500 Subject: [PATCH] sim: include stdlib.h for atoi() Make sure the files using atoi() include stdlib.h for its prototype. These files were relying on it being included implicitly by others which isn't guaranteed, and newer toolchains produce warnings. --- sim/arm/ChangeLog | 4 ++++ sim/arm/wrapper.c | 1 + sim/bfin/ChangeLog | 4 ++++ sim/bfin/machs.c | 2 ++ sim/igen/ChangeLog | 4 ++++ sim/igen/gen-icache.c | 1 + sim/igen/igen.c | 3 +-- sim/ppc/ChangeLog | 4 ++++ sim/ppc/gen-icache.c | 1 + sim/ppc/igen.c | 3 +-- 10 files changed, 23 insertions(+), 4 deletions(-) diff --git a/sim/arm/ChangeLog b/sim/arm/ChangeLog index 75fcec27c6d..9b5b7807823 100644 --- a/sim/arm/ChangeLog +++ b/sim/arm/ChangeLog @@ -1,3 +1,7 @@ +2021-01-04 Mike Frysinger + + * wrapper.c: Include stdlib.h. + 2021-01-04 Mike Frysinger * iwmmxt.c: Include stdlib.h. diff --git a/sim/arm/wrapper.c b/sim/arm/wrapper.c index 874e37c4641..5fc753a71af 100644 --- a/sim/arm/wrapper.c +++ b/sim/arm/wrapper.c @@ -23,6 +23,7 @@ #include "config.h" #include #include +#include #include #include #include diff --git a/sim/bfin/ChangeLog b/sim/bfin/ChangeLog index b000b82d7b9..3b9b13d8ae5 100644 --- a/sim/bfin/ChangeLog +++ b/sim/bfin/ChangeLog @@ -1,3 +1,7 @@ +2021-01-04 Mike Frysinger + + * machs.c: Include stdlib.h. + 2021-01-04 Mike Frysinger * dv-bfin_dma.c: Include stdlib.h. diff --git a/sim/bfin/machs.c b/sim/bfin/machs.c index 9b66f94a642..8b7b1060887 100644 --- a/sim/bfin/machs.c +++ b/sim/bfin/machs.c @@ -20,6 +20,8 @@ #include "config.h" +#include + #include "sim-main.h" #include "gdb/sim-bfin.h" #include "bfd.h" diff --git a/sim/igen/ChangeLog b/sim/igen/ChangeLog index b34bcc200c5..bf2ee3e912e 100644 --- a/sim/igen/ChangeLog +++ b/sim/igen/ChangeLog @@ -1,3 +1,7 @@ +2021-01-04 Mike Frysinger + + * gen-icache.c, igen.c: Include stdlib.h. + 2021-01-04 Mike Frysinger * configure: Regenerate. diff --git a/sim/igen/gen-icache.c b/sim/igen/gen-icache.c index 11d6135c647..ce79c74370f 100644 --- a/sim/igen/gen-icache.c +++ b/sim/igen/gen-icache.c @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#include #include "misc.h" #include "lf.h" diff --git a/sim/igen/igen.c b/sim/igen/igen.c index f2f117f9f7a..d0e0da979bb 100644 --- a/sim/igen/igen.c +++ b/sim/igen/igen.c @@ -19,9 +19,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - - #include +#include #include "misc.h" #include "lf.h" diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 6f0d58df7e5..041e27a635b 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,7 @@ +2021-01-04 Mike Frysinger + + * gen-icache.c, igen.c: Include stdlib.h. + 2021-01-04 Mike Frysinger * acinclude.m4 (ACX_BUGURL): Change http:// to https://. diff --git a/sim/ppc/gen-icache.c b/sim/ppc/gen-icache.c index 8acf3fba122..eb35e94949d 100644 --- a/sim/ppc/gen-icache.c +++ b/sim/ppc/gen-icache.c @@ -17,6 +17,7 @@ */ +#include #include "misc.h" #include "lf.h" diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 5a1df3ee911..c036f049aef 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -17,9 +17,8 @@ */ - - #include +#include #include "misc.h" #include "lf.h" -- 2.30.2