config/doc/config.guess.1
Petr Vorel 9d1d9d5260 config.guess: Avoid implicit int in definitions of main.
Implicit ‘int’ (e.g. ‘extern foo();’ meaning the same thing as
‘extern int foo();’) was dropped from the C standard in its 1999
edition.  Twenty-five years later, free C compilers are finally
starting to make this an error by default, so let’s not use it
anymore in config.guess probe programs.

(Note: As of this writing, GCC 14 and Clang 16 are both more lenient
for ‘main() { … }’ specifically than for other uses of implicit int.
Still, the writing is clearly on the wall.)

We continue to use ‘int main() { … }’, instead of ‘int main(void) { … }’,
because these programs may be compiled by truly ancient compilers that
do not recognize the keyword ‘void’.  This leaves open the possibility
of a compiler that errors by default on an empty argument list in a
function definition, which, prior to the 2024 C standard, is technically
still an “old-style” function definition; but we can worry about that
if and when it comes up.

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Co-authored-by: Zack Weinberg <zack@owlfolio.org>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2024-05-13 20:55:28 +00:00

49 lines
1.7 KiB
Groff

.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5.
.TH CONFIG.GUESS "1" "May 2024" "GNU config.guess (2024-04-03)" "User Commands"
.SH NAME
config.guess \- guess the build system triplet
.SH SYNOPSIS
.B config.guess
[\fI\,OPTION\/\fR]
.SH DESCRIPTION
The GNU build system distinguishes three types of machines, the
`build' machine on which the compilers are run, the `host' machine
on which the package being built will run, and, exclusively when you
build a compiler, assembler etc., the `target' machine, for which the
compiler being built will produce code.
This script will guess the type of the `build' machine.
.PP
Output the configuration name of the system 'config.guess' is run on.
.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
print this help, then exit
.TP
\fB\-t\fR, \fB\-\-time\-stamp\fR
print date of last modification, then exit
.TP
\fB\-v\fR, \fB\-\-version\fR
print version number, then exit
.SH "ENVIRONMENT VARIABLES"
config.guess might need to compile and run C code, hence it needs a
compiler for the `build' machine: use the environment variable
`CC_FOR_BUILD' to specify the compiler for the build machine. If
`CC_FOR_BUILD' is not specified, `CC' will be used. Be sure to
specify `CC_FOR_BUILD' if `CC' is a cross-compiler to the `host'
machine.
CC_FOR_BUILD a native C compiler, defaults to `cc'
CC a native C compiler, CC_FOR_BUILD is preferred
.SH "REPORTING BUGS"
Report bugs and patches to <config\-patches@gnu.org>.
.PP
.br
Originally written by Per Bothner.
.br
Copyright 1992\-2024 Free Software Foundation, Inc.
.PP
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.