Opened 8 months ago

Last modified 8 months ago

#68175 assigned defect

postgresql15 @15.4: warning about implicit declaration of strchr should be suppressed

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: dgilman (David Gilman)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: barracuda156
Port: postgresql15

Description

Configuring postgresql15 prints this warning:

Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled:
  strchr: found in postgresql-15.4/config.log

This message should be suppressed because it is not a problem. See WimplicitFunctionDeclaration#strchr

Please fix in all affected postgresql* ports. (Not all postgresql* ports may be affected, depending on whether they use autoreconf and, if not, which version of autoconf their configure scripts were built with.)

Change History (2)

comment:1 Changed 8 months ago by dgilman (David Gilman)

The configure script here winds up triggering two false positives, one for strchr and one when testing for arm crc32c intrinsics on x86. I expect all supported releases of postgresql to trigger the warning. But I don't see the 'Configuration logfiles' warning in GitHub CI or in the buildbot logs. There is evidence in the config.log but for whatever reason MP is not giving the warning. I also don't see that warning when configuring locally. I agree that they are false positives but I am reluctant to start whitelisting things until I can reproduce it locally.

comment:2 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)

This ticket is about the strchr warning only. The reason why it should be suppressed in this port is specific to this port. The warning will only appear if the configure script was built with autoconf 2.71 or later or if autoreconf is used (since the MacPorts version of autoconf is 2.71 or later).

I cannot speak to the other implicit function declarations reported which is why I did not mention them. If they are standard functions on other operating systems that just don't exist on macOS, then they should be listed in the global files, not in the portfile. You said they exist on arm but not on x86. I do not know how that should be handled in MacPorts since the global files are global and not architecture-specific. You could ask on the macports-dev mailing list. It would be good to have a standard way of handling this, if this seems likely to be a common situation in other ports.

CI and buildbot do not provide a way for you to access the config.log files.

MacPorts' detection of implicit function declarations relies on parsing the config.log files for warnings with a particular wording, based on the wording used in Apple Clang 12 and 13. llvm.org Clang 15 and later also contains this feature but uses a different wording for the message and Apple adopted that new wording in Apple Clang 14 and later. MacPorts base has been updated to handle the new wording (#67504) but there has not yet been a new release of MacPorts containing that fix. You can either build with older versions of Clang to get warnings with the old wording or you can build the MacPorts base master from source so that it understands the new wording.

Note: See TracTickets for help on using tickets.