Opened 10 years ago

Closed 9 years ago

#26064 closed defect (fixed)

ncftp fails to build: conflicting types for getdomainname

Reported by: macports@… Owned by: tobypeterson
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: Cc: michaelld (Michael Dickens)
Port: ncftp


This is on MacOS 10.6.4 on a MacBook Pro.

The relevant portion of the log is:

:info:build Compiling PWrite.c.
:info:build   /usr/bin/gcc-4.2 -D_REENTRANT -pipe -O2 -arch x86_64 -Wno-format-y2k -static-libgcc
:info:build    -DMACOSX -DHAVE_CONFIG_H -DMACOSX -I/opt/local/var/macports/build/_opt_mports_trun
:info:build   k_dports_net_ncftp/work/ncftp-3.2.4 -I/opt/local/var/macports/build/_opt_mports_tru
:info:build   nk_dports_net_ncftp/work/ncftp-3.2.4/libncftp -I/opt/local/var/macports/build/_opt_
:info:build   mports_trunk_dports_net_ncftp/work/ncftp-3.2.4/sio -I/opt/local/var/macports/build/
:info:build   _opt_mports_trunk_dports_net_ncftp/work/ncftp-3.2.4/Strn -I/opt/local/include DNSUt
:info:build   il.c -c:info:build   DNSUtil.c:22: error: conflicting types for 'getdomainname'
:info:build   /usr/include/unistd.h:531: error: previous declaration of 'getdomainname' was here
:info:build make[1]: *** [DNSUtil.o] Error 1

Complete build log attached.

Attachments (2)

main.log (21.8 KB) - added by macports@… 10 years ago.
Build log for NCFTP
ncftp_Portfile.diff (504 bytes) - added by michaelld (Michael Dickens) 10 years ago.
Patch to correct 'gethostname_size_t' usage in 'getdomainname' function.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by macports@…

Attachment: main.log added

Build log for NCFTP

comment:1 Changed 10 years ago by jmroot (Joshua Root)

Owner: changed from macports-tickets@… to toby@…

Please remember to cc the maintainer.

comment:2 Changed 10 years ago by michaelld (Michael Dickens)

I'm attaching a patch that fixes it for me on x86_64, and should work on any Darwin platform (no matter 32 or 64 bit). The issue is that the function 'getdomainname' -always- takes an 'int' for its second argument (at least on Darwin), but the release code uses 'gethostname_size_t' which will end up being a 'size_t' type -- which is -not- an 'int' no matter how many bits you have. This patch replaces the 'gethostname_size_t' with 'int' in just the single file of issue: sio/DNSUtil.c .

Changed 10 years ago by michaelld (Michael Dickens)

Attachment: ncftp_Portfile.diff added

Patch to correct 'gethostname_size_t' usage in 'getdomainname' function.

comment:3 Changed 10 years ago by michaelld (Michael Dickens)

Cc: michaelld@… added

Cc Me!

comment:4 Changed 9 years ago by tobypeterson

Resolution: fixed
Status: newclosed

Better fix committed in r74679

Note: See TracTickets for help on using tickets.