Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

rt.util.utf: add attributes#1600

Merged
andralex merged 1 commit intodlang:masterfrom
WalterBright:utfannotate
Jul 3, 2016
Merged

rt.util.utf: add attributes#1600
andralex merged 1 commit intodlang:masterfrom
WalterBright:utfannotate

Conversation

@WalterBright
Copy link
Member

Trivial. Just added annotations that the compiler would pass.

@andralex
Copy link
Member

andralex commented Jul 3, 2016

Auto-merge toggled on

@andralex andralex merged commit d1bdcaa into dlang:master Jul 3, 2016
@schveiguy
Copy link
Member

Note that we have to be careful about adding attributes "that pass", especially where @safe is involved. In this case, toUtf16z is returning a pointer to a null-terminated string. While the "trick" passed in this other PR works, it's disingenuous. A @safe function that returns a pointer is only supposed to be returning a pointer to the single element, not an array as toUTF16z is doing.

see this recent discussion: #2053

I feel like toUTF16z was improperly marked @safe, but not sure what we can do about it now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants