From 8d68f9adb08794758a85bf0727dadf120e8411eb Mon Sep 17 00:00:00 2001 From: Thomas Jensen Date: Fri, 29 Mar 2019 18:29:20 +0100 Subject: [PATCH] Remove some compile warnings on current MinGW --- src/boxes.c | 1 + src/misc/getopt.c | 13 +++++++------ src/tools.c | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/boxes.c b/src/boxes.c index 8de84f3..66b5524 100644 --- a/src/boxes.c +++ b/src/boxes.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/src/misc/getopt.c b/src/misc/getopt.c index 39e2056..7c41e23 100644 --- a/src/misc/getopt.c +++ b/src/misc/getopt.c @@ -74,11 +74,10 @@ #ifdef VMS # include -# if HAVE_STRING_H - 0 -# include -# endif #endif +#include + #ifndef _ /* This is for other GNU distributions with internationalized messages. When compiling libc, the _ macro is predefined. */ @@ -696,17 +695,19 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only) } else { - if (opterr) - if (argv[optind - 1][1] == '-') + if (opterr) { + if (argv[optind - 1][1] == '-') { /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); - else + } else { /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); + } + } nextchar += strlen (nextchar); diff --git a/src/tools.c b/src/tools.c index 296e991..9054aab 100644 --- a/src/tools.c +++ b/src/tools.c @@ -28,6 +28,7 @@ #include #include #include +#include #include "shape.h" #include "boxes.h" #include "tools.h"