diff options
author | Björn Gustavsson <bjorn@erlang.org> | 2020-09-24 06:50:07 +0200 |
---|---|---|
committer | Björn Gustavsson <bjorn@erlang.org> | 2021-02-18 12:04:00 +0100 |
commit | f1ba748e325015cf2f5743ea692ed20ea69b00b3 (patch) | |
tree | e97e9bfc748135b0c00b5f22121ff05b678225cb | |
parent | f32b878cfbadf1243bf88b47c80f254d47a174d2 (diff) | |
download | erlang-f1ba748e325015cf2f5743ea692ed20ea69b00b3.tar.gz |
erts: Eliminate warnings in C code in tests
Apple Clang 12 in Xcode 12 reports an error for the use of a
function without a declaration.
5 files changed, 16 insertions, 4 deletions
diff --git a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c index 685cda3e07..b69d75c31d 100644 --- a/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c +++ b/erts/emulator/test/driver_SUITE_data/peek_non_existing_queue_drv.c @@ -47,6 +47,10 @@ #include <windows.h> #endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + #include <errno.h> #include "erl_driver.h" diff --git a/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c b/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c index 56183c9484..503d8b902c 100644 --- a/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c +++ b/erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c @@ -18,6 +18,10 @@ * %CopyrightEnd% */ +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + #include "erl_driver.h" #define THR_MSG_BLAST_NO_PROCS 10 diff --git a/erts/emulator/test/estone_SUITE_data/estone_cat.c b/erts/emulator/test/estone_SUITE_data/estone_cat.c index a34bda4384..cbdf3db6c9 100644 --- a/erts/emulator/test/estone_SUITE_data/estone_cat.c +++ b/erts/emulator/test/estone_SUITE_data/estone_cat.c @@ -12,9 +12,11 @@ #include <fcntl.h> #include <errno.h> -main(argc, argv) -int argc; -char *argv[]; +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif + +int main(int argc, char* argv[]) { char buf[16384]; int n; diff --git a/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c b/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c index 46ee8b5540..6f662ae514 100644 --- a/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c +++ b/erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c @@ -39,6 +39,7 @@ #include <errno.h> #include <stdio.h> +#include <string.h> static int fail(const char *file, int line, const char *function, const char *assertion); diff --git a/erts/emulator/test/port_bif_SUITE_data/port_test.c b/erts/emulator/test/port_bif_SUITE_data/port_test.c index 923ab99ccc..ef6d12dc93 100644 --- a/erts/emulator/test/port_bif_SUITE_data/port_test.c +++ b/erts/emulator/test/port_bif_SUITE_data/port_test.c @@ -10,6 +10,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <ctype.h> #ifndef __WIN32__ #include <unistd.h> @@ -32,7 +33,7 @@ exit(1); \ } -#define MAIN(argc, argv) main(argc, argv) +#define MAIN(argc, argv) int main(argc, argv) extern int errno; |