mirror of
git://git.sv.gnu.org/autoconf
synced 2025-01-30 11:01:45 +08:00
AC_FUNC_MBRTOWC: Don't assume that a function F exists merely because
the compiler and linker let you compile an expression like (F != 0).
This commit is contained in:
parent
77cf219604
commit
3999390896
@ -1,5 +1,13 @@
|
||||
2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
* lib/autoconf/functions.m4 (AC_FUNC_MBRTOWC): Don't assume that a
|
||||
function F exists if the compiler and linker let you compile an
|
||||
expression like (F != 0). Recent versions of GCC optimize away
|
||||
the reference to F in that case, since every function address must
|
||||
be nonzero, so the link succeeds even if F does not exist.
|
||||
Problem reported by Manu in
|
||||
<http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00060.html>.
|
||||
|
||||
* doc/autoconf.texi (Systemology): Standardize on the spelling of
|
||||
"Unix". Many uses changed.
|
||||
(Limitations of Builtins): Explain better why the ! command isn't
|
||||
|
@ -889,7 +889,11 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[@%:@include <wchar.h>]],
|
||||
[[mbstate_t state; return ! (sizeof state && mbrtowc);]])],
|
||||
[[wchar_t wc;
|
||||
char const s[] = "";
|
||||
size_t n = 1;
|
||||
mbstate_t state;
|
||||
return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
|
||||
ac_cv_func_mbrtowc=yes,
|
||||
ac_cv_func_mbrtowc=no)])
|
||||
if test $ac_cv_func_mbrtowc = yes; then
|
||||
|
Loading…
Reference in New Issue
Block a user