[MacPorts] #65558: tcp_wrappers: header file tcpd.h doesn't guard against multiple inclusion, potentially causing build errors in dependents

MacPorts noreply at macports.org
Thu Jul 28 14:37:56 UTC 2022


#65558: tcp_wrappers: header file tcpd.h doesn't guard against multiple inclusion,
potentially causing build errors in dependents
---------------------+--------------------------
 Reporter:  mascguy  |      Owner:  mascguy
     Type:  defect   |     Status:  assigned
 Priority:  Normal   |  Milestone:
Component:  ports    |    Version:  2.7.2
 Keywords:           |       Port:  tcp_wrappers
---------------------+--------------------------
 While one might argue that dependent projects should avoid including the
 same header multiple times, that's not always easy to avoid. Hence the
 reason why headers include guards, preventing errors when that occurs.

 One real-world example is `openldap` 2.6.x, when variant `+wrappers` is
 enabled:

 {{{
 In file included from util-int.c:950:
 /opt/local/include/tcpd.h:20:16: error: redefinition of 'sockaddr_gen'
 typedef struct sockaddr_gen {
                ^
 ../../include/lutil.h:24:11: note: '/opt/local/include/tcpd.h' included
 multiple times, additional include site here
 # include <tcpd.h>
           ^
 util-int.c:950:11: note: '/opt/local/include/tcpd.h' included multiple
 times, additional include site here
 # include <tcpd.h>
           ^
 /opt/local/include/tcpd.h:20:16: note: unguarded header; consider using
 #ifdef guards or #pragma once
 typedef struct sockaddr_gen {
                ^
 }}}

 Patch said header, to include a guard.

-- 
Ticket URL: <https://trac.macports.org/ticket/65558>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list