[MacPorts] WimplicitFunctionDeclaration modified

MacPorts Wiki noreply at macports.org
Sun May 7 15:05:06 UTC 2023


Page "WimplicitFunctionDeclaration" was changed by ryandesign
Diff URL: <https://trac.macports.org/wiki/WimplicitFunctionDeclaration?action=diff&version=9>
Revision 9
Comment: Reword section about port-specific whitelist
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: WimplicitFunctionDeclaration
=========================================================================
--- WimplicitFunctionDeclaration (version: 8)
+++ WimplicitFunctionDeclaration (version: 9)
@@ -235,15 +235,21 @@
 
 Then create a Pull Request modifying the whitelist file(s) appropriate for the version(s) of the macOS SDK which you have tested. The change will be simple: to add a line to the file, inserting a new line with the function name, in the correct lexical order. This change will take effect when the user updates their ports tree. It applies to all ports, when configured on the version of macOS which corresponds to the whitelist file.
 
-
 == Add names to whitelist via Portfile ==
 
-Another approach is to add the function name via the Portfile, via a line like:
+Sometimes the reason why implicit function declaration(s) should be allowed is not general to a macOS version but is specific to a port. The most common instance of this is that recent versions of autoconf deliberately try to use `strchr` without including the right header in order to see how the compiler reacts to that:
+
+{{{
+checking for /usr/bin/clang options needed to detect all undeclared functions... none needed
+}}}
+
+If a port generates or regenerates its configure script using `autoconf` or `autoreconf` (or a script like `autogen.sh` that calls them), or if the project's existing configure script was generated by a recent enough version of autoconf, verify by reading the config.log whether this is the only place where `strchr` is declared implicitly. (If there are any other instances, fix them as usual.) Then suppress the remaining warning by adding to the Portfile:
+
 {{{
 configure.checks.implicit_function_declaration.whitelist-append strchr
 }}}
 
-This adds the function name (in this example, `strchr`) to the whitelist for the current Portfile, regardless of macOS SDK version. Do this if the reason why this function should be ignored is specific to this port, rather than to the macOS version. For example, configure scripts generated with the latest version of autoconf will complain erroneously about the implicit declaration of `strchr` because the latest version of autoconf deliberately tries to use `strchr` without including the right header in order to see how the compiler reacts to that.
+If the warning is occurring because the Portfile contains code that causes the configure script to be generated or regenerated, it is customary to place the whitelist line right afterward to show that it is related.
 
 == Respond by filing upstream bug reports ==
 
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/WimplicitFunctionDeclaration>
MacPorts <https://www.macports.org/>
Ports system for macOS

This is an automated message. Someone added your email address to be
notified of changes on 'WimplicitFunctionDeclaration' page.
If it was not you, please report to admin at macports.org.


More information about the macports-changes mailing list