configure: Improve the getopt_long_only() test
authorBart Van Assche <bvanassche@acm.org>
Mon, 6 Jan 2020 19:00:24 +0000 (11:00 -0800)
committerBart Van Assche <bvanassche@acm.org>
Mon, 6 Jan 2020 19:01:38 +0000 (11:01 -0800)
Fix the following build error if configure is invoked with
--extra-cflags=-Werror:

/tmp/fio-conf-20209-133775-26866.c: In function 'main':
/tmp/fio-conf-20209-133775-26866.c:6:11: error: null argument where non-null required (argument 3) [-Werror=nonnull]
   int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
           ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
configure

index 65ce36623126dd1c44c7dd2d27e8ad0d2d86ad9e..c11b7cdab51a96a4b27229ed37b0f19759d85056 100755 (executable)
--- a/configure
+++ b/configure
@@ -1374,7 +1374,7 @@ cat > $TMPC << EOF
 #include <getopt.h>
 int main(int argc, char **argv)
 {
-  int c = getopt_long_only(argc, argv, NULL, NULL, NULL);
+  int c = getopt_long_only(argc, argv, "", NULL, NULL);
   return c;
 }
 EOF