[Bug 5083] New: osutils.c uses POSIX XPG4_2 features but does not specify _XOPEN_SOURCE nor _POSIX_C_SOURCE

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Feb 4 17:54:51 UTC 2016


https://bz.mercurial-scm.org/show_bug.cgi?id=5083

            Bug ID: 5083
           Summary: osutils.c uses POSIX XPG4_2 features  but does not
                    specify _XOPEN_SOURCE nor _POSIX_C_SOURCE
           Product: Mercurial
           Version: 3.7
          Hardware: PC
                OS: Other
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: bugzilla at selenic.com
          Reporter: richard at NetBSD.org
                CC: mercurial-devel at selenic.com

The following error is encountered on SunOS when building from the mercurial
3.7 tarball.

building 'mercurial.osutil' extension
gcc -DNDEBUG -O2 -DHAVE_DB_185_H -pthread -I/usr/include
-I/opt/local/include/db5 -I/opt/local/include -I/opt/local/include/ncurses -O2
-I/usr/include -I/opt/local/include -I/usr/include -I/opt/local/include -fPIC
-I/opt/local/include/python2.7 -c mercurial/osutil.c -o
build/temp.solaris-2.11-i86pc.32bit-2.7/mercurial/osutil.o
mercurial/osutil.c: In function 'recvfdstobuf':
mercurial/osutil.c:667:6: error: 'struct msghdr' has no member named
'msg_control'
  msgh.msg_control = cbuf;
      ^
mercurial/osutil.c:668:6: error: 'struct msghdr' has no member named
'msg_controllen'
  msgh.msg_controllen = (socklen_t)cbufsize;
      ^
mercurial/osutil.c:672:12: warning: assignment makes pointer from integer
without a cast
  for (cmsg = CMSG_FIRSTHDR(&msgh); cmsg;
            ^
mercurial/osutil.c:673:12: warning: assignment makes pointer from integer
without a cast
       cmsg = CMSG_NXTHDR(&msgh, cmsg)) {
            ^

this is tried on pkgsrc with gcc49.

These structure components seem to be added in SUSv2 (XPG5)
http://pubs.opengroup.org/onlinepubs/7908799/xns/syssocket.h.html
so adding -D_XOPEN_SOURCE=500 naturally permits a successful build
with the default compiler (although at least XPG6 may be needed with
a strict c99 or later compliant compiler)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list