[MacPorts] #69631: gcc-devel does not build on Sonoma: error: call to undeclared function 'dup2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

MacPorts noreply at macports.org
Sun Mar 31 19:17:35 UTC 2024


#69631: gcc-devel does not build on Sonoma: error: call to undeclared function
'dup2'; ISO C99 and later do not support implicit function declarations
[-Wimplicit-function-declaration]
---------------------------+--------------------
  Reporter:  barracuda156  |      Owner:  (none)
      Type:  defect        |     Status:  new
  Priority:  Normal        |  Milestone:
 Component:  ports         |    Version:  2.9.1
Resolution:                |   Keywords:  sonoma
      Port:  gcc-devel     |
---------------------------+--------------------

Comment (by ryandesign):

 [https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup.html POSIX
 says] `dup2` is in <unistd.h> but I don't see that header included by
 libiberty/filedescriptor.c. You could try adding that `#include` and see
 if it solves the problem. It looks like this code was [https://github.com
 /gcc-mirror/gcc/commit/8f88e7f6f8ed55effda60b6475d8dbcb247dd9a2 moved to
 filedescriptor.c from another file 4.5 years ago], and that other file did
 include <unistd.h>. In any case, it's probably an upstream problem that
 needs to be reported the developers of gcc.

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


More information about the macports-tickets mailing list