[Issue 9766] New: align(n) with n compile-time constant
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Mar 20 11:10:13 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9766
Summary: align(n) with n compile-time constant
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-03-20 11:10:12 PDT ---
enum uint myAlignment = 16;
align(myAlignment) struct Foo {}
void main() {}
DMD 2.063alpha gives:
temp.d(2): Error: positive integer expected, not myAlignment
With this a single compile-time constant change is enough to modify at the same
time and in the same way for different CPUs various alignments in the code.
It's good to be more DRY and avoid magic constants.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list