Go to file
Zack Weinberg b045574cb2
AC_INCLUDES_DEFAULT: Check for presence of C90 hosted headers (#110393)
Since 1993, Autoconf has been assuming that it is safe to include any
of the headers defined by ISO C90 without checking for them; this is
inaccurate, since only a subset are necessarily available in a
C90 *freestanding* environment.

It is OK to assume the presence of a header in a macro that checks
specifically for something declared by that header (if the header is
not present, we will think the specific declaration is unavailable,
which is probably accurate for modern embedded environments).  It is
also OK to continue recommending that user code use these headers
unconditionally—anyone working with a freestanding environment knows
it.  But it is not OK for very generic code within Autoconf itself,
such as AC_INCLUDES_DEFAULT, to make this assumption.

Note that the set of headers that are not always available includes
stdio.h, which we have been assuming can be included unconditionally
for even longer.

In AC_INCLUDES_DEFAULT, revert to checking for string.h and stdlib.h
before including them.  Also revert to defining STDC_HEADERS only when
string.h and stdlib.h are available (but do not check for float.h and
stdarg.h, as these are part of the freestanding set).  Add a new check
for stdio.h.  Sort the inclusion list by standard (C90 freestanding;
C90 hosted; C99; POSIX) and alphabetically within each group.  Revise
all the documentation and update the testsuite.

This partially reverts commit 86c213d0e3
and is a partial fix for bug #110393.

* lib/autoconf/headers.m4 (AC_CHECK_INCLUDES_DEFAULT): Check for
  stdio.h, stdlib.h, and string.h before including them.  Define
  STDC_HEADERS only when string.h and stdlib.h are both available.
  Organize includes list by standard, then alphabetically.

* doc/autoconf.texi, NEWS: Update to match.

* tests/local.at (AT_CHECK_DEFINES): Make regexes more specific.
  Also expect a definition of HAVE_STDIO_H.
* tests/c.at, tests/semantics.at, tests/tools.at: Use <float.h>,
  not <stdio.h>, as a header that we expect always to exist.
  Add HAVE_STDIO_H to various lists of macros that are expected to
  appear in config.h.
2020-12-06 11:40:39 -05:00
bin Make autoreconf --force --install overwrite existing files (#110371) 2020-11-30 18:06:26 -05:00
build-aux make fetch and update savannah gitweb urls to cgit. 2020-11-30 11:45:24 -05:00
doc AC_INCLUDES_DEFAULT: Check for presence of C90 hosted headers (#110393) 2020-12-06 11:40:39 -05:00
lib AC_INCLUDES_DEFAULT: Check for presence of C90 hosted headers (#110393) 2020-12-06 11:40:39 -05:00
m4 make fetch 2020-09-03 12:08:31 -04:00
man Generate manpages directly from source code. 2020-08-21 16:23:32 -04:00
tests AC_INCLUDES_DEFAULT: Check for presence of C90 hosted headers (#110393) 2020-12-06 11:40:39 -05:00
.gitattributes
.gitignore Check in install-sh as synced from automake (#110368) 2020-11-09 13:51:20 -05:00
.prev-version
.x-update-copyright
AUTHORS maint: make update-copyright 2020-01-01 11:45:50 -08:00
BUGS BUGS: Remove mention of old shells lacking functions. 2020-08-28 16:44:59 -04:00
cfg.mk Rewrite fetch.sh in Perl. 2020-09-11 14:51:00 -04:00
ChangeLog.0 Prefer HTTPS to FTP and HTTP 2017-09-16 17:48:51 -07:00
ChangeLog.1 Prefer HTTPS to FTP and HTTP 2017-09-16 17:48:51 -07:00
ChangeLog.2 Prefer HTTPS to FTP and HTTP 2017-09-16 17:48:51 -07:00
ChangeLog.3 maint: update URLs 2017-09-23 12:49:23 -07:00
configure.ac Add NetBSD /bin/sh to the -n whitelist. 2020-08-26 15:08:26 -04:00
COPYING Update links in COPYING, COPYINGv3, and COPYING.EXCEPTION. 2020-07-10 16:43:22 -04:00
COPYING.EXCEPTION Update links in COPYING, COPYINGv3, and COPYING.EXCEPTION. 2020-07-10 16:43:22 -04:00
COPYINGv3 Update links in COPYING, COPYINGv3, and COPYING.EXCEPTION. 2020-07-10 16:43:22 -04:00
GNUmakefile Partially revert e54e3f90: restore use of $(MAKE) in error message. 2020-08-04 08:46:59 -04:00
HACKING Update release advice 2020-06-29 17:08:27 -07:00
maint.mk sc_error_message_uppercase: allow fully uppercased words 2020-11-30 11:45:25 -05:00
Makefile.am Generate manpages directly from source code. 2020-08-21 16:23:32 -04:00
NEWS AC_INCLUDES_DEFAULT: Check for presence of C90 hosted headers (#110393) 2020-12-06 11:40:39 -05:00
README maint: make update-copyright 2020-01-01 11:45:50 -08:00
README-alpha maint: make update-copyright 2020-01-01 11:45:50 -08:00
README-hacking make fetch and update savannah gitweb urls to cgit. 2020-11-30 11:45:24 -05:00
THANKS maint: make update-copyright 2020-01-01 11:45:50 -08:00
TODO * TODO: Add -Werror support. 2020-08-06 12:28:40 -07:00

-*- text -*-

Autoconf

Autoconf is an extensible package of M4 macros that produce shell
scripts to automatically configure software source code packages.
These scripts can adapt the packages to many kinds of UNIX-like
systems without manual user intervention.  Autoconf creates a
configuration script for a package from a template file that lists the
operating system features that the package can use, in the form of M4
macro calls.

Producing configuration scripts using Autoconf requires GNU M4 and
Perl.  You should install GNU M4 (version 1.4.6 or later is required;
1.4.14 or later is recommended) and Perl (5.006 or later) before
configuring Autoconf, so that Autoconf's configure script can find
them.  The configuration scripts produced by Autoconf are
self-contained, so their users do not need to have Autoconf (or GNU
M4, Perl, etc.).

You can get GNU M4 here:

https://ftp.gnu.org/gnu/m4/

The file INSTALL should be distributed with packages that use
Autoconf-generated configure scripts and Makefiles that conform to the
GNU coding standards.  The package's README can just give an overview
of the package, where to report bugs, and a pointer to INSTALL for
instructions on compilation and installation.  This removes the need
to maintain many similar sets of installation instructions.

Be sure to read BUGS and INSTALL.

Mail suggestions to autoconf@gnu.org, report bugs to
bug-autoconf@gnu.org, and submit patches to autoconf-patches@gnu.org.
All changes can be tracked at the read-only autoconf-commit@gnu.org.
Always include the Autoconf version number, which you can get by
running `autoconf --version'.  Archives of bug-autoconf@gnu.org can be
found in <https://lists.gnu.org/archive/html/bug-autoconf/>, and
similarly for the other mailing lists.

Licensing

Autoconf is released under the General Public License version 3 (GPLv3+).
Additionally, Autoconf includes a licensing exception in some of its
source files; see the respective copyright notices for how your
project is impacted by including scripts generated by Autoconf, and the
COPYING.EXCEPTION file for the exception in terms of the Additional
Permissions as described in section 7 of GPLv3.

For more licensing information, see
<https://www.gnu.org/licenses/gpl-faq.html> and
<https://www.gnu.org/licenses/exceptions.html>.

For any copyright year range specified as YYYY-ZZZZ in this package
note that the range specifies every single year in that closed interval.

-----

Copyright (C) 1992-1994, 1998, 2000-2017, 2020 Free Software Foundation,
Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without warranty of any kind.