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

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1098 - symbol collision in d/dmd/expression.c between math.h and port.h
Summary: symbol collision in d/dmd/expression.c between math.h and port.h
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: David Friedman
URL:
Keywords:
Depends on:
Blocks:
Reported: 2007年04月05日 16:09 UTC by mpb
Modified: 2015年06月09日 05:15 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description mpb 2007年04月05日 16:09:50 UTC
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 Walter Bright 2007年04月20日 13:19:05 UTC
Fixed DMD 1.013


AltStyle によって変換されたページ (->オリジナル) /