changeset 39798:cc685716a57d

glob: Fix over-optimization due to attribute __nonnull__. * lib/glob.c (_GL_ARG_NONNULL): Define to empty.
author Bruno Haible <bruno@clisp.org>
date Sun, 19 Aug 2018 12:03:27 +0200
parents 6dc99dd431fb
children b0ba15e72c3c
files ChangeLog lib/glob.c
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Aug 19 11:47:06 2018 +0200
+++ b/ChangeLog	Sun Aug 19 12:03:27 2018 +0200
@@ -1,3 +1,8 @@
+2018-08-19  Bruno Haible  <bruno@clisp.org>
+
+	glob: Fix over-optimization due to attribute __nonnull__.
+	* lib/glob.c (_GL_ARG_NONNULL): Define to empty.
+
 2018-08-19  Bruno Haible  <bruno@clisp.org>
 
 	glob: Fix another compilation error when glob.h is not replaced.
--- a/lib/glob.c	Sun Aug 19 11:47:06 2018 +0200
+++ b/lib/glob.c	Sun Aug 19 12:03:27 2018 +0200
@@ -16,7 +16,13 @@
    <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   optimizes away the pattern == NULL test below.  */
+# define _GL_ARG_NONNULL(params)
+
 # include <config.h>
+
 #endif
 
 #include <glob.h>