#64550 closed defect (fixed)
freeciv @2.6.6: at_quick_exit gives -Wimplicit-function-declaration warning, false positive
Reported by: | JDLH (Jim DeLaHunt) | Owned by: | JDLH (Jim DeLaHunt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | Cc: | ||
Port: | freeciv |
Description
When building freeciv @2.6.6 (work in progress, a major rewrite, see #62984), MacPorts prints a warning, "indications of -Wimplicit-function-declaration", regarding function named at_quick_exit
. This is a false positive. The configuration code which the port uses does explicitly include <stdlib.h>
to declare the function. My "Apple clang version 11.0.0 (clang-1100.0.33.12)" compiler apparently lacks that feature of the C11 standard library.
This is the initial warning from MacPorts:
% sudo port build freeciv-common ---> Computing dependencies for freeciv-common ---> Fetching distfiles for freeciv-common ---> Verifying checksums for freeciv-common ---> Extracting freeciv-common ---> Configuring freeciv-common Warning: Configuration logfiles contain indications of -Wimplicit-function-declaration; check that features were not accidentally disabled: strcmp: found in freeciv-2.6.6/config.log exit: found in freeciv-2.6.6/config.log at_quick_exit: found in freeciv-2.6.6/config.log ---> Building freeciv-common %
Change History (7)
comment:1 follow-up: 3 Changed 3 years ago by JDLH (Jim DeLaHunt)
comment:2 Changed 3 years ago by JDLH (Jim DeLaHunt)
Port: | freeciv added |
---|
Oops, enter "freeciv" in the Port field.
comment:3 Changed 3 years ago by jmroot (Joshua Root)
Replying to JDLH:
So, I think the immediate workaround for this problem is to add
at_quick_exit
to the list at <https://github.com/macports/macports-ports/blob/master/_resources/port1.0/checks/implicit_function_declaration/macosx10.14.sdk.list>.
That's not a workaround, that's the fix. Without this outside information, it's impossible to know whether the error is due to a missing include or due to the system not implementing the function.
I also plan to file a bug upstream with FreeCiv developers, to see if they have a way to rewrite this configuration test so that it does not trigger a
-Wimplicit-function-declaration
warning from the compiler.
Unlikely; that's just how autoconf works.
comment:4 Changed 3 years ago by JDLH (Jim DeLaHunt)
Created branch 64550-Add-at_quick_exit-to-10.14-whitelist to my fork of macports-ports, and Pull Request #13804 ''64550 Add 'at_quick_exit' to 10.14 whitelist''.
comment:5 Changed 3 years ago by Jim DeLaHunt <from+github@…>
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:6 Changed 3 years ago by JDLH (Jim DeLaHunt)
I did a port selfupdate
on my local system. I see the result of this fix:
% cd /opt/local/var/macports//sources/rsync.macports.org/release/tarballs/ports/_resources/port1.0/ % grep at_quick_exit checks/implicit_function_declaration/macosx*.sdk.list checks/implicit_function_declaration/macosx10.10.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.11.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.12.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.13.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.14.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.4u.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.5.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.6.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.7.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.8.sdk.list:at_quick_exit checks/implicit_function_declaration/macosx10.9.sdk.list:at_quick_exit
Thank you, Clemens, for your help!
comment:7 Changed 3 years ago by JDLH (Jim DeLaHunt)
I filed upstream ticket 43863 Configure script test for at_quick_exit (C11 feature) causes undesirable -Wimplicit-function-declaration error on macOS to ask the Freeciv project to change their configuration checks so that they don't generate -Wimplicit-function-declaration errors. I expect it will take quite some time for them to make such a change, if they do at all. Probably Freeciv versions 2.6.x and 3.0.x will continue to generate these errors.
The whitelisting of at_quick_exit
in MacPorts should protect users from inconvenience for the immediate next Freeciv versions.
More diagnosis on this warning.
In the
config.log
, the relevant configuration output is (with line breaks added for legibility):Note that this code does contain
#include <stdlib.h>
. Thus the function definition would not be implicit if the stdlib supported theat_quick_exit
C11 language feature.See email thread How to suppress -Wimplicit-function-declaration warning, if <stdlib.h> really does not have the declaration?, started Wed Jan 26 07:43:23 UTC 2022. Joshua Root replied,
So, I think the immediate workaround for this problem is to add
at_quick_exit
to the list at <https://github.com/macports/macports-ports/blob/master/_resources/port1.0/checks/implicit_function_declaration/macosx10.14.sdk.list>. I do not know how many other macOS versions are affected.I also plan to file a bug upstream with FreeCiv developers, to see if they have a way to rewrite this configuration test so that it does not trigger a
-Wimplicit-function-declaration
warning from the compiler.