#67504 closed defect (fixed)
Implicit function declaration detection code doesn't work with newer clang
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | MacPorts 2.9.0 |
Component: | base | Version: | 2.8.1 |
Keywords: | haspatch | Cc: | neverpanic (Clemens Lang) |
Port: |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
MacPorts fails to detect implicit declaration of function errors in configure scripts when using open source clang 15 or later or clang from Xcode 14 (?) or later because the wording of the error message has changed. For example trying the pkgconfig port:
% xcodebuild -version Xcode 13.2.1 Build version 13C100 %
% sudo port clean pkgconfig ---> Cleaning pkgconfig % sudo port configure pkgconfig ---> Computing dependencies for pkgconfig ---> Fetching distfiles for pkgconfig ---> Verifying checksums for pkgconfig ---> Extracting pkgconfig ---> Applying patches to pkgconfig ---> Configuring pkgconfig Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled: pthread_cond_timedwait_monotonic_np: found in pkg-config-0.29.2/glib/config.log pthread_condattr_setclock: found in pkg-config-0.29.2/glib/config.log strcmp: found in pkg-config-0.29.2/glib/config.log exit: found in pkg-config-0.29.2/glib/config.log pthread_cond_timedwait_monotonic: found in pkg-config-0.29.2/glib/config.log %
% sudo port clean pkgconfig ---> Cleaning pkgconfig % sudo port configure pkgconfig configure.compiler=macports-clang-15 ---> Computing dependencies for pkgconfig ---> Fetching distfiles for pkgconfig ---> Verifying checksums for pkgconfig ---> Extracting pkgconfig ---> Applying patches to pkgconfig ---> Configuring pkgconfig %
The wording of the errors when they debuted in Xcode 12 was originally:
error: implicitly declaring library function '…' with type '…' [-Werror,-Wimplicit-function-declaration]
and
error: implicit declaration of function '…' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
but now it has changed to:
error: call to undeclared library function '…' with type '…'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
and
error: call to undeclared function '…'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
Our code currently searches only for the regular expression (?:implicit declaration of function|implicitly declaring library function) '(\[^']+)'
in config.log. This will have to be extended to catch the new wording as well, noting that in the new wording the function name is not in quotation marks in one of the messages. Perhaps we should structure the regexp so that it can work whether or not the function names are in quotes, in case they change one or the other message in the future for consistency.
We probably have to update the documentation in WimplicitFunctionDeclaration too.
Change History (4)
comment:1 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
comment:2 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | haspatch added |
---|---|
Milestone: | → MacPorts Future |
comment:3 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)
Owner: | set to ryandesign |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:4 Changed 12 months ago by jmroot (Joshua Root)
Milestone: | MacPorts Future → MacPorts 2.9.0 |
---|
Excuse me, looking at the logs I see that the function names are still in quotes.