autoconf
[Top][All Lists]
Advanced

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

Re: Will autoconf work with -Werror=implicit-int and -Werror=implicit-fu


From: Zack Weinberg
Subject: Re: Will autoconf work with -Werror=implicit-int and -Werror=implicit-function-declaration ?
Date: Wed, 13 Dec 2023 15:22:47 -0500
User-agent: Cyrus-JMAP/3.9.0-alpha0-1283-g327e3ec917-fm-20231207.002-g327e3ec9

On Wed, Dec 13, 2023, at 9:29 AM, Florian Weimer wrote:
>   configure.ac: Define _DEFAULT_SOURCE along with _XOPEN_SOURCE
>   <https://github.com/samtools/htslib/pull/1711>

Trunk autoconf produces a configure script for that library which reports
"checking for getpagesize...yes" and "checking for working mmap... yes",
without the changes in that pull request, with GCC 13 and glibc 2.37,
even if CC is set to

gcc -std=c11 -Werror=implicit-function-declaration -Werror=implicit-int
-Werror=int-conversion -Werror=incompatible-pointer-types

"make check" runs to completion, with no test failures reported.

On the same system, this test program fails to compile with
those options:

#define _XOPEN_SOURCE 600
#include <unistd.h>
int main(void)
{ return getpagesize(); }

complaining about an implicit declaration of getpagesize.

... There may still be a problem, though: after the above tests,
htslib's config.h has "#define HAVE_GETPAGESIZE 1" in it, because
AC_FUNC_MMAP provided its own declaration of getpagesize.  There
may be programs that trust HAVE_GETPAGESIZE to mean unistd.h declares
getpagesize.

> I can't test this with htslib unfortunately because I'm not able to
> build autoconf from sources for some reason.

What errors are you getting?

zw



reply via email to

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