Warning: -Wimplicit-function-declaration

Ryan Schmidt ryandesign at macports.org
Thu May 20 06:05:07 UTC 2021


On May 19, 2021, at 19:21, Bjarne D Mathiesen wrote:
> 
> MacPorts 2.7.0
> I've just done my usual :
> port -dN selfupdate
> port outdated
> port clean --all outdated
> port -upN upgrade outdated
> port -pN clean --work installed
> 
> & I got this :
> 
> --->  Configuring snort
> Warning: Configuration logfiles contain indications of
> -Wimplicit-function-declaration; check that features were not
> accidentally disabled:
>  pcap_lex_destroy: found in snort-2.9.17.1/config.log
> --->  Building snort
> 
> 
> --->  Configuring wget
> Warning: Configuration logfiles contain indications of
> -Wimplicit-function-declaration; check that features were not
> accidentally disabled:
>  MIN: found in wget-1.21.1/config.log
>  strchr: found in wget-1.21.1/config.log
> --->  Building wget
> 
> I've never seen this before !?!
> Is it something I have to worry about ?!?
> And if so : how do I fix it ?!?

Sometimes programs are written to use functions before declaring them. This has not been correct ever since the introduction of the 1999 version of the C standard decades ago, but because it was allowed by the earlier 1989 C standard many C99 compilers still allowed this with a warning. But it can cause programs to crash or behave incorrectly on ARM processors, therefore to avoid problems on Apple Silicon Macs, the version of clang in included with Xcode 12 and later considers this to be an error. This causes some ports to fail to build. Worse, many configure tests have this problem, but when they fail, it doesn't cause configure to immediately fail and tell you that; instead, configure just makes wrong determinations about your system. In the best case, the build still succeeds and works fine. Or, the build fails with a bizarre error later. Or the build succeeds but is wrong.

The message you're quoting is a new feature of MacPorts 2.7.0. It now notices when an implicit declaration of function error occurred during configuration, so that the port maintainer can investigate whether this is a problem. The port maintainer can then either fix the problem, or can mark the port to indicate that that particular implicit declaration of function does not represent a problem.

If many programs check for functions which we know are not ever present on certain versions of macOS, then we can mark that in a central location rather than individually in each affected port.



More information about the macports-users mailing list