[Issue 13589] [git-head] Asm statement could be assumed to nothrow, safe, pure by the enclosing function attribute

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Oct 8 08:29:13 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13589

Martin Nowak <code at dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at dawg.eu

--- Comment #2 from Martin Nowak <code at dawg.eu> ---
(In reply to Kenji Hara from comment #1)
> And more, I'd disallow asm @safe {/*...*/} , because we already have the
> best attribute @trusted to assume the code as such.

Disallowing @safe makes sense.

I don't agree with reusing the containing function attributes though because it
breaks the let me try if I can make this function pure/nothrow/@safe pattern.
When I add an attribute to a function with an asm statement it would silently
compile even though noone checked the attributes. Think of a github pull
request diff where you see added attributes on a function but not the asm
statement withing the body.

--


More information about the Digitalmars-d-bugs mailing list