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 5b2470333c37f4fdca8d443d7eafd4a20e1d938d..78d3b35fb4adb6a6f5f7da9cfa27f9a1edf9dfea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
index cbd47775afed071dca16903c4645e0a0c8d79256..063f9195260c4af4eeb305136d5f0f7e49897407 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;