www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9766] New: align(n) with n compile-time constant

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs 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: -------
Mar 20 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9766


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman gmail.com


--- Comment #1 from bearophile_hugs eml.cc 2013-05-23 09:58:16 PDT ---
*** Issue 10149 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23 2013