]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/tst-environ.c
hurd: Fix build
[thirdparty/glibc.git] / stdlib / tst-environ.c
index 6317d5121e91b8517e519f9a69f9b73eebdb2ad5..ffbb518b2e802d24484af724e4cc1f08f5c5104f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-
+#include <libc-diag.h>
 
 #define VAR "FOOBAR"
 
@@ -196,12 +196,17 @@ do_test (void)
       result = 1;
     }
 
+  /* This deliberately tests supplying a null pointer to a function whose
+     argument is marked __attribute__ ((nonnull)). */
+  DIAG_PUSH_NEEDS_COMMENT;
+  DIAG_IGNORE_NEEDS_COMMENT(5, "-Wnonnull");
   errno = 0;
   if (unsetenv (NULL) >= 0 || errno != EINVAL)
     {
       puts ("unsetenv #1 failed");
       result = 1;
     }
+  DIAG_POP_NEEDS_COMMENT;
 
   errno = 0;
   if (unsetenv ("") >= 0 || errno != EINVAL)