--- Comment #2 from Dan G. <> 2012-01-29 14:41:27 PST ---
(In reply to comment #1)
> I'm really not understanding this.
> "align" by itself means default alignment. How that would differ from align(0)
> escapes me.

The problem is how the front end treats "align".  


struct B
    char a;

$ dmd -o- align.d -H 

// D import file generated from 'align.d'
// Notice align became align (8)
struct B
    align (8) char a;



That treatment of "align" conflicts with what's in the specification.

"align by itself sets it to the default, which matches the default member
alignment of the companion C compiler."

"Integer specifies the alignment which matches the behavior of the companion C
compiler when non-default alignments are used."

The front end has no way to indicate default alignment is what the user wants
and is effectively rewriting the default alignment expression to be an Integer
alignment expression.

By setting "n = 0" instead of "n = global.structalign" if clearly indicates to
the compiler default alignment is desired.  This is beneficial for when the
default compiler is not DMD.  

A description of GCC's aligned attribute which GDC attempted to mimic.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to