strtok_r: Avoid triggering bug in AIX 7.1 xlc compiler.
authorBruno Haible <bruno@clisp.org>
Fri, 30 Jul 2010 19:37:36 +0000 (21:37 +0200)
committerBruno Haible <bruno@clisp.org>
Fri, 30 Jul 2010 19:37:36 +0000 (21:37 +0200)
ChangeLog
m4/strtok_r.m4

index 5b24703..78d3b35 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2010-07-30  Bruno Haible  <bruno@clisp.org>
 
+       strtok_r: Avoid triggering bug in AIX 7.1 xlc compiler.
+       * m4/strtok_r.m4 (gl_FUNC_STRTOK_R): Don't cast an invalid address to
+       a 'char *'.
+       Reported by Rainer Tammer.
+
+2010-07-30  Bruno Haible  <bruno@clisp.org>
+
        unlink: Update regarding AIX.
        * doc/posix-functions/unlink.texi: Mention bug on AIX 7.1.
        * m4/unlink.m4 (gl_FUNC_UNLINK): Update comment.
index cbd4777..063f919 100644 (file)
@@ -1,4 +1,4 @@
-# strtok_r.m4 serial 10
+# strtok_r.m4 serial 11
 dnl Copyright (C) 2002-2004, 2006-2007, 2009-2010 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
@@ -30,8 +30,9 @@ AC_DEFUN([gl_FUNC_STRTOK_R],
               #include <stdlib.h>
               #include <string.h>
             ]],
-            [[char delimiters[] = "xxxxxxxx";
-              char *save_ptr = (char *) 0xd0d0;
+            [[static const char dummy[] = "\177\01a";
+              char delimiters[] = "xxxxxxxx";
+              char *save_ptr = (char *) dummy;
               strtok_r (delimiters, "x", &save_ptr);
               strtok_r (NULL, "x", &save_ptr);
               return 0;