[MacPorts] #67504: Implicit function declaration detection code doesn't work with newer clang

MacPorts noreply at macports.org
Fri May 26 04:19:04 UTC 2023


#67504: Implicit function declaration detection code doesn't work with newer clang
------------------------+--------------------
 Reporter:  ryandesign  |      Owner:  (none)
     Type:  defect      |     Status:  new
 Priority:  Normal      |  Milestone:
Component:  base        |    Version:  2.8.1
 Keywords:              |       Port:
------------------------+--------------------
 MacPorts fails to detect [wiki:WimplicitFunctionDeclaration 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
 [ticket:66435 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 [https://github.com/llvm/llvm-
 project/commit/7d644e1215b376ec5e915df9ea2eeb56e2d94626#diff-
 45afb7c228db564d8bdd83dc86deb16a2de9a21943e8b6693068f43c939d2170 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 [https://github.com/macports/macports-
 base/blob/82b064968d0ae5561911b850249939a7f77ae158/src/port1.0/portconfigure.tcl#LL1879C73-L1879C110
 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.

-- 
Ticket URL: <https://trac.macports.org/ticket/67504>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list