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

Conversation

nordlow
Copy link
Contributor

@nordlow nordlow commented Mar 20, 2014

No description provided.

@monarchdodra
Copy link
Contributor

to inhibit warnings

Not just that, for correctness :)

If the function is strongly pure, then the compiler can strip it out completely !

@monarchdodra
Copy link
Contributor

Auto-merge toggled on

@nordlow nordlow changed the title Issue 3882: Remove pure qualifier for assumeSafeAppend to inhibit warnings Issue 3882: Remove pure qualifier for assumeSafeAppend Mar 20, 2014
@nordlow nordlow changed the title Issue 3882: Remove pure qualifier for assumeSafeAppend Issue 3882: Remove pure qualifier from assumeSafeAppend Mar 20, 2014
@dnadlinger
Copy link
Contributor

Auto-merge toggled off

@dnadlinger
Copy link
Contributor

Wait a second: If the function is indeed pure, why wouldn't it also be inferred as such, making this a no-op change? (Feel free to enable auto-merging again if I'm missing something.)

@nordlow
Copy link
Contributor Author

nordlow commented Mar 20, 2014

Oops, _d_arrayshrinkfit should be unpured aswell, right?

Otherwise the compiler can optimize away its call and assumeSafeAppend will have no side-effect GC-wise.

@andralex, @monarchdodra or @schveiguy, what do you say?

@monarchdodra
Copy link
Contributor

Wait a second: If the function is indeed pure , why wouldn't it also be inferred as such

It's a forward declaration: There's no inference here.

@nordlow
Copy link
Contributor Author

nordlow commented Mar 20, 2014

ping

@monarchdodra
Copy link
Contributor

Oops, _d_arrayshrinkfit should be unpured aswell, right?

It's a forward declaration: There's no inference here.

Oops. Yes, of course. _d_arrayshrinkfit should not be marked as pure. He's the real culprit. Good catch @klickverbot .

@nordlow
Copy link
Contributor Author

nordlow commented Mar 20, 2014

Ready to roll?

@nordlow nordlow changed the title Issue 3882: Remove pure qualifier from assumeSafeAppend Issue 3882: Remove pure qualifier from assumeSafeAppend and _d_arrayshrinkfit Mar 20, 2014
@monarchdodra
Copy link
Contributor

Squash?

@dnadlinger
Copy link
Contributor

Yes, please squash the changes into one commit (e.g. using git rebase -i), as the history is otherwise confusing to follow (the first commit doesn't actually do much in terms of language semantics).

…shrinkfit prevent calls from being optimized away
@nordlow
Copy link
Contributor Author

nordlow commented Mar 20, 2014

Done! :)

@monarchdodra
Copy link
Contributor

Auto-merge toggled on

@nordlow
Copy link
Contributor Author

nordlow commented Mar 20, 2014

Thanks.

monarchdodra added a commit that referenced this pull request Mar 20, 2014
Issue 3882: Remove pure qualifier from assumeSafeAppend and _d_arrayshrinkfit
@monarchdodra monarchdodra merged commit 542b310 into dlang:master Mar 20, 2014
@nordlow nordlow deleted the warn-unused-returns branch March 20, 2014 20:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants