From 7e86fc26ec74657b88e927117ca295ee71be7586 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 28 Nov 2006 03:29:47 +0000 Subject: [PATCH] Turn AC_FUNC_SETVBUF_REVERSED into a noop. It's been obsolete for years and is too hard to maintain now. The last straw was reported by Jerker Baeck in . * NEWS: AC_FUNC_SETVBUF_REVERSED is now obsolete. * doc/autoconf.texi (Particular Functions): Move AC_FUNC_SETVBUF_REVERSED from here... (Obsolete Macros): ... to here. Say that it does nothing now. * lib/autoconf/functions.m4 (AC_FUNC_SETVBUF_REVERSED): Turn into (almost) a no-op. --- ChangeLog | 11 +++++++++++ NEWS | 7 +++++++ doc/autoconf.texi | 26 +++++++++++++------------- lib/autoconf/functions.m4 | 45 +++------------------------------------------ 4 files changed, 34 insertions(+), 55 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13ab60a7..eccd2341 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2006-11-27 Paul Eggert + Turn AC_FUNC_SETVBUF_REVERSED into a noop. It's been obsolete for + years and is too hard to maintain now. The last straw was + reported by Jerker Baeck in + . + * NEWS: AC_FUNC_SETVBUF_REVERSED is now obsolete. + * doc/autoconf.texi (Particular Functions): Move + AC_FUNC_SETVBUF_REVERSED from here... + (Obsolete Macros): ... to here. Say that it does nothing now. + * lib/autoconf/functions.m4 (AC_FUNC_SETVBUF_REVERSED): + Turn into (almost) a no-op. + * lib/autoconf/c.m4 (AC_PROG_GCC_TRADITIONAL, AC_C_CONST): (AC_C_VOLATILE): Do not recommend via AN_FUNCTION, AN_IDENTIFIER, or AN_HEADER. diff --git a/NEWS b/NEWS index adc5780c..4f2ded1e 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,12 @@ * Major changes in Autoconf 2.61a (??) +** AC_FUNC_SETVBUF_REVERSED is now obsolete. It is still defined for backward + compatibility but it does nothing. The macro was already + obsolescent, as the last systems to have the problem were those + based on SVR2, which became obsolete in 1987. The macro had bugs + on some modern systems and could no longer be maintained reliably + due to lack of ancient systems to test it on. + ** config.status now uses awk instead of sed for most substitutions, for speed. It is now documented that Makefile.in should not contain overlapping variable occurrences, e.g., @VAR1@VAR2@. Autoconf's diff --git a/doc/autoconf.texi b/doc/autoconf.texi index a244000a..4a0d8749 100644 --- a/doc/autoconf.texi +++ b/doc/autoconf.texi @@ -4782,19 +4782,6 @@ These macros are obsolescent, as no current systems have the bug. New programs need not use these macros. @end defmac -@defmac AC_FUNC_SETVBUF_REVERSED -@acindex{FUNC_SETVBUF_REVERSED} -@cvindex SETVBUF_REVERSED -@c @fuindex setvbuf -@prindex @code{setvbuf} -If @code{setvbuf} takes the buffering type as its second argument and -the buffer pointer as the third, instead of the other way around, define -@code{SETVBUF_REVERSED}. - -This macro is obsolescent, as no current systems have the bug. -New programs need not use this macro. -@end defmac - @defmac AC_FUNC_STRCOLL @acindex{FUNC_STRCOLL} @cvindex HAVE_STRCOLL @@ -16607,6 +16594,19 @@ and sets @code{EMXOS2}. @code{AC_CHECK_FUNC} @end defmac +@defmac AC_FUNC_SETVBUF_REVERSED +@acindex{FUNC_SETVBUF_REVERSED} +@cvindex SETVBUF_REVERSED +@c @fuindex setvbuf +@prindex @code{setvbuf} +Do nothing. Formerly, this macro checked whether @code{setvbuf} takes +the buffering type as its second argument and the buffer pointer as the +third, instead of the other way around, and defined +@code{SETVBUF_REVERSED}. However, the last systems to have the problem +were those based on SVR2, which became obsolete in 1987, and the macro +is no longer needed. +@end defmac + @defmac AC_FUNC_WAIT3 @acindex{FUNC_WAIT3} @cvindex HAVE_WAIT3 diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index 256bbefa..440b886d 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -1670,48 +1670,9 @@ test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen]) # AC_FUNC_SETVBUF_REVERSED # ------------------------ AC_DEFUN([AC_FUNC_SETVBUF_REVERSED], -[AC_REQUIRE([AC_C_PROTOTYPES])dnl -AC_CACHE_CHECK(whether setvbuf arguments are reversed, - ac_cv_func_setvbuf_reversed, - [ac_cv_func_setvbuf_reversed=no - AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include -# ifdef PROTOTYPES - int (setvbuf) (FILE *, int, char *, size_t); -# endif]], - [[char buf; return setvbuf (stdout, _IOLBF, &buf, 1);]])], - [AC_LINK_IFELSE( - [AC_LANG_PROGRAM( - [[#include -# ifdef PROTOTYPES - int (setvbuf) (FILE *, int, char *, size_t); -# endif]], - [[char buf; return setvbuf (stdout, &buf, _IOLBF, 1);]])], - [# It compiles and links either way, so it must not be declared - # with a prototype and most likely this is a K&R C compiler. - # Try running it. - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [AC_INCLUDES_DEFAULT], - [[/* This call has the arguments reversed. - A reversed system may check and see that the address of buf - is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ - char buf; - if (setvbuf (stdout, _IOLBF, &buf, 1) != 0) - return 1; - putchar ('\r'); - return 0; /* Non-reversed systems SEGV here. */]])], - [ac_cv_func_setvbuf_reversed=yes], - [], - [[: # Assume setvbuf is not reversed when cross-compiling.]])] - ac_cv_func_setvbuf_reversed=yes)])]) -if test $ac_cv_func_setvbuf_reversed = yes; then - AC_DEFINE(SETVBUF_REVERSED, 1, - [Define to 1 if the `setvbuf' function takes the buffering type as - its second argument and the buffer pointer as the third, as on - System V before release 3.]) -fi +[AC_DIAGNOSE([obsolete], +[The macro `$0' is obsolete. Remove it and all references to SETVBUF_REVERSED.])dnl +AC_CACHE_VAL([ac_cv_func_setvbuf_reversed], [ac_cv_func_setvbuf_reversed=no]) ])# AC_FUNC_SETVBUF_REVERSED -- 2.11.4.GIT