# HG changeset patch # User Christian Kamm # Date 1224333191 -7200 # Node ID 20a5180f2e80718b9ffb1c9c986ec28a8eee4a36 # Parent b972fb129d3719394e7d593cbad1b0a863bf74ee Make align(n), n != 1 an error. diff -r b972fb129d37 -r 20a5180f2e80 dmd/attrib.c --- a/dmd/attrib.c Thu Oct 16 22:36:26 2008 +0200 +++ b/dmd/attrib.c Sat Oct 18 14:33:11 2008 +0200 @@ -492,10 +492,14 @@ /********************************* AlignDeclaration ****************************/ -AlignDeclaration::AlignDeclaration(unsigned sa, Array *decl) +AlignDeclaration::AlignDeclaration(Loc loc, unsigned sa, Array *decl) : AttribDeclaration(decl) { + this->loc = loc; salign = sa; + + if (salign != 1) + error("align(%d) is not implemented and specified to be unportable anyway, use align(1) and manual fillers instead", salign); } Dsymbol *AlignDeclaration::syntaxCopy(Dsymbol *s) @@ -503,7 +507,7 @@ AlignDeclaration *ad; assert(!s); - ad = new AlignDeclaration(salign, Dsymbol::arraySyntaxCopy(decl)); + ad = new AlignDeclaration(loc, salign, Dsymbol::arraySyntaxCopy(decl)); return ad; } diff -r b972fb129d37 -r 20a5180f2e80 dmd/attrib.h --- a/dmd/attrib.h Thu Oct 16 22:36:26 2008 +0200 +++ b/dmd/attrib.h Sat Oct 18 14:33:11 2008 +0200 @@ -90,7 +90,7 @@ { unsigned salign; - AlignDeclaration(unsigned sa, Array *decl); + AlignDeclaration(Loc loc, unsigned sa, Array *decl); Dsymbol *syntaxCopy(Dsymbol *s); void semantic(Scope *sc); void toCBuffer(OutBuffer *buf, HdrGenState *hgs); diff -r b972fb129d37 -r 20a5180f2e80 dmd/parse.c --- a/dmd/parse.c Thu Oct 16 22:36:26 2008 +0200 +++ b/dmd/parse.c Sat Oct 18 14:33:11 2008 +0200 @@ -367,7 +367,7 @@ n = global.structalign; // default a = parseBlock(); - s = new AlignDeclaration(n, a); + s = new AlignDeclaration(loc, n, a); break; }