[MacPorts] WimplicitFunctionDeclaration modified

MacPorts Wiki noreply at macports.org
Sat Jan 29 06:26:25 UTC 2022


Page "WimplicitFunctionDeclaration" was changed by ryandesign
Diff URL: <https://trac.macports.org/wiki/WimplicitFunctionDeclaration?action=diff&version=8>
Revision 8
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: WimplicitFunctionDeclaration
=========================================================================
--- WimplicitFunctionDeclaration (version: 7)
+++ WimplicitFunctionDeclaration (version: 8)
@@ -215,20 +215,25 @@
 
 == Add names to implicit declaration whitelist ==
 
-In cases where you have confirmed that a function name is not declared by the include file which should declare it, for a certain macOS SDK, then add that name to whitelists in the MacPorts codebase. This means that, when the compiler generates a `-Wimplicit-function-declaration` warning for that name, MacPorts will not elevate that warning to the `main.log`. Thus it will not cause concern to MacPorts users who use ports which test for that fucntion name. 
-
-The whitelists are in the MacPorts codebase at `[https://github.com/macports/macports-ports/tree/master/_resources/port1.0/checks/implicit_function_declaration _resources/port1.0/checks/implicit_function_declaration]`. There is a separate whitelist for each version of the macOS SDK: macOS 10.5, macOS 10.14, macOS 11.0 (stored as macOS 11), etc. Each whitelist is a text file containing a list of C language function names, one per line, in lexical order.
-
-To add a name to the whitelist, first convince yourself that the name is in fact no declared by the include file which should declare it, by creating a brief test program which uses that function. Compile that file with a compiler invocation similar to what MacPorts uses, including `-Werror`. The compiler will implicitly add `-Wimplicit-function-declaration` if it is recent enough to be able to compile ARM code. The compilation should fail with an error message like, 
-
-{{{
-warning: implicitly declaring library function '…' with type '…'
-      [-Wimplicit-function-declaration]
+In cases where you have confirmed that a function name is not declared by the include file which should declare it, for a certain macOS SDK, then add that name to whitelists in the MacPorts ports tree. This means that, when the compiler generates a `-Wimplicit-function-declaration` warning for that name, MacPorts will not display that warning in the terminal output. Thus it will not cause concern to MacPorts users who use ports which test for that fucntion name. 
+
+The whitelists are [browser:macports-ports/_resources/port1.0/checks/implicit_function_declaration in the ports tree]. There is a separate whitelist for each version of the macOS SDK: Mac OS X 10.5, macOS 10.14, macOS 11, etc. Each whitelist is a text file containing a list of C language function names, one per line, in lexical order.
+
+To add a name to the whitelist, first convince yourself that the name is in fact not declared by the include file which should declare it, by creating and compiling a brief test program which uses that function. Observe if you get a warning or error message like:
+
+{{{
+error: implicitly declaring library function '…' with type '…' [-Werror,-Wimplicit-function-declaration]
+}}}
+
+or:
+
+{{{
+error: implicit declaration of function '…' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
 }}}
 
 You may be able to test using multiple different versions of the macOS SDK. That is good. It is desireable to add a function name to all the whitelists to which it applies.
 
-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 downloads a new version of the MacPorts base code. It applies to all ports, when configured on the version of macOS which corresponds to the whitelist file.
+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 ==
@@ -238,9 +243,7 @@
 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.
-
-**TODO**: explain when it is better to change the whitelists, and when it is better to add a `configure.checks.implicit_function_declaration.whitelist-append` to the Portfile.
+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.
 
 == 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