Bug 1311 – DMD 1.018: Fix for bug657 breaks other code
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-07-02T20:32:00Z
Last change time
2014-02-16T15:22:15Z
Assigned to
nobody
Creator
aldacron
Comments
Comment #0 by aldacron — 2007-07-02T20:32:31Z
The following worked for over three years until DMD 1.018:
####################
version(Windows)
extern(Windows):
else
extern(C):
typedef void function() foo;
...
#####################
Compilation with DMD 1.018 results in the following error:
"Declaration expected, not 'else'"
Adding brackets compiles successfully:
####################
version(Windows)
{
extern(Windows):
}
else
{
extern(C):
}
typedef void function() foo;
...
#####################
Unfortunately, this form causes the executable to crash on both Windows and Linux. It appears the extern statements are being ignored.
This affects several packages in Derelict, causing them to be unusable with 1.018 without a rather large rewrite. I assume this is a result of the fix for bug657.
Comment #1 by clayasaurus — 2007-07-03T20:45:47Z
This bug is blocking the Arc v.2 release.
Comment #2 by tomas — 2007-10-05T09:47:42Z
According to the changelog for DMD 0.74:
* Version declarations can now wrap attribute : and they'll stick.
Why did this feature suddenly turn into a bug?
Comment #3 by clugdbug — 2009-08-06T13:13:18Z
The functionality was restored by introducing extern(System) for exactly this situation. I'll mark this as fixed.