Skip to content

Commit

Permalink
erts: Eliminate warnings in C code in tests
Browse files Browse the repository at this point in the history
Apple Clang 12 in Xcode 12 reports an error for the use of a
function without a declaration.
  • Loading branch information
bjorng committed Feb 18, 2021
1 parent f32b878 commit f1ba748
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#include <windows.h>
#endif

#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif

#include <errno.h>

#include "erl_driver.h"
Expand Down
4 changes: 4 additions & 0 deletions erts/emulator/test/driver_SUITE_data/thr_msg_blast_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions erts/emulator/test/estone_SUITE_data/estone_cat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions erts/emulator/test/mtx_SUITE_data/mtx_SUITE.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion erts/emulator/test/port_bif_SUITE_data/port_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>

#ifndef __WIN32__
#include <unistd.h>
Expand All @@ -32,7 +33,7 @@
exit(1); \
}

#define MAIN(argc, argv) main(argc, argv)
#define MAIN(argc, argv) int main(argc, argv)

extern int errno;

Expand Down

0 comments on commit f1ba748

Please sign in to comment.