Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 Jul 2022 20:39:06 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   Re: git: 4ba3797c9993 - main - graphics/png: fix build with clang 15
Message-ID:  <5yjd-6sad-wny@FreeBSD.org>
In-Reply-To: <202207311714.26VHEL73016804@gitrepo.freebsd.org> (Dimitry Andric's message of "Sun, 31 Jul 2022 17:14:21 GMT")
References:  <202207311714.26VHEL73016804@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Dimitry Andric <dim@FreeBSD.org> writes:

> The branch main has been updated by dim (src committer):
>
> URL: https://cgit.FreeBSD.org/ports/commit/?id=4ba3797c9993a25a082ed767d4f44234b1f7dc04
>
> commit 4ba3797c9993a25a082ed767d4f44234b1f7dc04
> Author:     Dimitry Andric <dim@FreeBSD.org>
> AuthorDate: 2022-07-30 16:37:48 +0000
> Commit:     Dimitry Andric <dim@FreeBSD.org>
> CommitDate: 2022-07-31 17:12:11 +0000
>
>     graphics/png: fix build with clang 15
>     
>     Building png with clang 15 results in an error:
>     
>         contrib/libtests/pngvalid.c:11662:4: error: call to undeclared function 'feenableexcept'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>            feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
>            ^
>     
>     This is because clang 15 introduced this new warning, and fenv.h only
>     declares feenableexcept() when compiling for C standards before C11.

-Wimplicit-function-declaration is ancient, so Clang 15 made it fatal
for C99 or later. feenableexcept() is under __BSD_VISIBLE, so hidden in
_POSIX_SOURCE mode as used by libpng. Linux cheats via _GNU_SOURCE
which is ignored on FreeBSD, so you get the above warning.

Where did C11 come from?

See also https://github.com/llvm/llvm-project/commit/7d644e1215b3



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5yjd-6sad-wny>