bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

logic of HAVE_STAT_EMPTY_STRING_BUG is inverted?


From: IIDA Yosiaki
Subject: logic of HAVE_STAT_EMPTY_STRING_BUG is inverted?
Date: 20 Sep 2006 14:23:47 +0900

Hello, autoconf maintainers.

In lib/autoconf/functions.m4 of autoconf-2.60, it reads
...
[AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[struct stat sbuf;
  return $1 ("", &sbuf) == 0;]])],
            [ac_cv_func_$1_empty_string_bug=no],
            [ac_cv_func_$1_empty_string_bug=yes],
            [ac_cv_func_$1_empty_string_bug=yes])])
...

In this logic, when stat (and/or lstat) returns 0,
the C main returns 1, which is the value of (0 == 0),
and sinse 1 is false command status, the line
  ac_cv_func_$1_empty_string_bug=yes
will be executed, where $1 is stat or lstat.

But, I see, it is a normal case that stat returns 0.

Likewise, when stat returns non-0 value, the line
  ac_cv_func_$1_empty_string_bug=no
will be executed, but it seems for me that this IS am empty
string bug.

I hope that the following patch will fix it.  Enjoy!
-  return $1 ("", &sbuf) == 0;]])],
+  return $1 ("", &sbuf);]])],
--
  iida




reply via email to

[Prev in Thread] Current Thread [Next in Thread]