#65558 closed defect (fixed)
tcp_wrappers: header file tcpd.h doesn't guard against multiple inclusion, potentially causing build errors in dependents
Reported by: | mascguy (Christopher Nielsen) | Owned by: | mascguy (Christopher Nielsen) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.2 |
Keywords: | Cc: | ||
Port: | tcp_wrappers |
Description
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.
Change History (2)
comment:1 Changed 2 years ago by Christopher Nielsen <mascguy@…>
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:2 Changed 2 years ago by Christopher Nielsen <mascguy@…>
Note: See
TracTickets for help on using
tickets.
In 2085880447a0c5e2c3b5e0616f37a836cb03244f/macports-ports (master):