[MacPorts] #74382: nmap @7.991: error: use of undeclared identifier 'strnlen' (was: nmap 7.991: fails on Snow Leopard with "undeclared 'strnlen'")
MacPorts
noreply at macports.org
Mon Aug 31 19:38:49 UTC 2026
#74382: nmap @7.991: error: use of undeclared identifier 'strnlen'
----------------------+---------------------------------
Reporter: balanco | Owner: ghosthound
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version:
Resolution: | Keywords: leopard snowleopard
Port: nmap |
----------------------+---------------------------------
Changes (by ryandesign):
* keywords: => leopard snowleopard
Comment:
Replying to [ticket:74382 balanco]:
> {{{
> …
> :info:build service_scan.cc:1333:22: error: use of undeclared
identifier 'strnlen'
> :info:build size_t linelen = strnlen(line, sizeof(line));
> :info:build ^
> :info:build 1 error generated.
> …
> }}}
>
> ☞ adding
> {{{
> PortGroup legacysupport 1.1
> }}}
> to the (the beginning of the…) portfile appears to cover this issue,
Yes, using legacysupport is the solution I'd suggest. Since `strnlen` was
introduced in macOS 10.7 / Darwin 11, this issue is specific macOS 10.6 /
Darwin 10 and earlier, so the following line should also be added to the
Portfile:
{{{
legacysupport.newest_darwin_requires_legacy 10
}}}
> but the following warning is still displayed:
>
> {{{
> Warning: Configuration logfiles contain indications of -Wimplicit-
function-declaration; check that features were not accidentally disabled:
> strchr: found in nmap-7.991/ncat/config.log
> }}}
I don't know for sure, since I haven't seen the config.log, but this
warning should likely be suppressed as per
WimplicitFunctionDeclaration#strchr.
--
Ticket URL: <https://trac.macports.org/ticket/74382#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list