Bug 17849 – Lexical link for align keyword goes to obscure iasm usage
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-09-22T14:00:08Z
Last change time
2017-09-22T19:44:23Z
Keywords
pull
Assigned to
No Owner
Creator
Peter Varo
Comments
Comment #0 by hello — 2017-09-22T14:00:08Z
The documentation of the https://dlang.org/spec/iasm.html#align keyword is incorrect. It is suggesting here: https://github.com/dlang/dlang.org/blob/master/spec/iasm.dd#L74, that this should be the correct way of using it:
```
struct S
{
align 64 ubyte b;
}
```
instead of the one, that can actually be compiled:
```
struct S
{
align(64) ubyte b;
}
```
Therefore further action is required:
- If the documented usage is the desired one, then this is a different issue, and that behaviour needs to be implemented.
- If the keyword requires parenthesis, then the documentation should be updated according to that.
Comment #1 by ag0aep6g — 2017-09-22T17:56:45Z
The iasm.html page is only about asm blocks. In an asm block, `align 64;` is correct.
The documentation for the align attribute is here:
https://dlang.org/spec/attribute.html#align
Closing as invalid.
Comment #2 by hello — 2017-09-22T18:43:23Z
My confusion was coming from the fact, that the 'lexical' page is referencing the 'iasm' when introducing the 'align' keyword. (https://github.com/dlang/dlang.org/blob/master/spec/lex.dd#L942)
I think the fact alone, that we have a keyword that can be used in two ways, yet the documentation fails to connect those two explaining the difference between these scenarios is confusing, not to mention how hard it is to follow/understand this for a new comer, who has no idea that D has a "built-in mini-language" and the official documentation they are following is pointing at the "lesser used feature"...
So I agree, the bug I reported is invalid, but the above case related to this one is still something that needs attention IMO.
Comment #3 by schveiguy — 2017-09-22T18:50:15Z
Agreed. There is no reason to link to iasm, as align is much more prevalent as a normal attribute. It's also telling that zero other keywords link to the iasm page. Reopening with altered title.