Changes between Version 8 and Version 9 of WimplicitFunctionDeclaration


Ignore:
Timestamp:
May 7, 2023, 3:05:06 PM (12 months ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

Reword section about port-specific whitelist

Legend:

Unmodified
Added
Removed
Modified
  • WimplicitFunctionDeclaration

    v8 v9  
    236236Then 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.
    237237
    238 
    239238== Add names to whitelist via Portfile ==
    240239
    241 Another approach is to add the function name via the Portfile, via a line like:
     240Sometimes 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:
     241
     242{{{
     243checking for /usr/bin/clang options needed to detect all undeclared functions... none needed
     244}}}
     245
     246If 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:
     247
    242248{{{
    243249configure.checks.implicit_function_declaration.whitelist-append strchr
    244250}}}
    245251
    246 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.
     252If 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.
    247253
    248254== Respond by filing upstream bug reports ==