[MacPorts] #62838: policykit @0.116_1+universal: error: implicit declaration of function 'fdatasync' is invalid in C99

MacPorts noreply at macports.org
Thu Jul 22 05:10:09 UTC 2021


#62838: policykit @0.116_1+universal: error: implicit declaration of function
'fdatasync' is invalid in C99
-------------------------+------------------------
  Reporter:  ryandesign  |      Owner:  dbevans
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.6.99
Resolution:              |   Keywords:  highsierra
      Port:  policykit   |
-------------------------+------------------------

Comment (by ryandesign):

 Note that I am adding `-Werror=implicit-function-declaration` to
 configure.cflags to mimic the behavior of Xcode 12 and later. Normally
 with Xcode 11 or earlier this would be a warning, not an error.

 Here is a report of a similar problem in PHP:
 https://bugs.php.net/bug.php?id=81130

 It seems that `fdatasync` does exist in the system library on macOS (which
 is why the "checking for fdatasync" configure check succeeds) but, oddly,
 macOS doesn't have a prototype for this function in the system headers
 (hence use of this function triggers an "implicit declaration of
 function"). PHP fixed the issue by declaring the prototype manually:
 https://github.com/php/php-
 src/commit/e69729f2ba02ddc26c70b4bd88ef86c0a2277bdc

 policykit might want to use the same solution.

 We have a successful build of policykit on our buildbot even on macOS 11
 with Xcode 12. I don't have a log of this handy so I don't know why this
 succeeded.

 We're several versions out of date on policykit (#63277). If the problem
 remains with the latest version, we should report it to the developers.

-- 
Ticket URL: <https://trac.macports.org/ticket/62838#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list