Bug 1098 – symbol collision in d/dmd/expression.c between math.h and port.h

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2007-04-05T16:09:00Z
Last change time
2015-06-09T05:15:02Z
Assigned to
dvdfrdmn
Creator
mpb.mail

Comments

Comment #0 by mpb.mail — 2007-04-05T16:09:50Z
d/dmd/expression.c includes math.h and port.h in that order. math.h defines macros for: isnan isfinite signbit port.h then declares a struct with: static int isnan(double); static int isfinite(double); static int isinfinity(double); static int signbit(double); The macros collide with the names in the struct declaration, causing a fatal compile time error. A kludge (that seems to work) is to change expression.c to include port.h *before* math.h. A clean long term solution is either: a) make sure no file ever includes both math.h and port.h (this is probably impractical) or... b) rename the offending names in port.h (and everywhere that refers to them) I am not sure if this bug should be fixed in DGCC or upstream in the DMD compiler sources. Thanks! -mpb
Comment #1 by bugzilla — 2007-04-20T13:19:05Z
Fixed DMD 1.013