http://d.puremagic.com/issues/show_bug.cgi?id=7396



--- Comment #16 from Daniel Green <ven...@gmail.com> 2012-01-30 12:23:45 PST ---
(In reply to comment #15)
> Right, it's a compiler issue. Not a language issue, and no new language
> features or syntax are required.

Yes, I agree.  My proposal was the following.

// excerpt from parse.c line 503.
case TOKalign:
{   unsigned n;

  s = NULL;
  nextToken();
  if (token.value == TOKlparen)
  {
    nextToken();
    if (token.value == TOKint32v && token.uns64value > 0)
      n = (unsigned)token.uns64value;
    else
    {   error("positive integer expected, not %s", token.toChars());
        n = 1;
    }
    nextToken();
    check(TOKrparen);
  }
  else
-    n = global.structalign; // default
+    n = 0; // default

  a = parseBlock();
  s = new AlignDeclaration(n, a);
  break;
}

Now the compiler can test for 0 and know that default alignment is required. 
This removes the ambiguity with the current implementation.

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

Reply via email to