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

Comments

[core.stdc.math] everything is pure#3050

Closed
thewilsonator wants to merge 1 commit intodlang:masterfrom
thewilsonator:pure-stdc-math
Closed

[core.stdc.math] everything is pure#3050
thewilsonator wants to merge 1 commit intodlang:masterfrom
thewilsonator:pure-stdc-math

Conversation

@thewilsonator
Copy link
Contributor

Everything in core.stdc.math so use an attribute at the top.

@thewilsonator thewilsonator added the Trivial typos, formatting, comments label Apr 21, 2020
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @thewilsonator! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + druntime#3050"

Everything in core.stdc.math so use an attribute at the top.
@thewilsonator
Copy link
Contributor Author

Thanks, fixed.

@ibuclaw
Copy link
Member

ibuclaw commented Apr 21, 2020

I don't think you can say that everything is pure when most alter errno.

@Geod24
Copy link
Member

Geod24 commented Apr 21, 2020

@ibuclaw
Copy link
Member

ibuclaw commented Apr 23, 2020

For your reference:

echo "module gcc.builtins;" | gdc -fsyntax-only -x d -Hf /dev/stdout - | less

Functions that are not intrinsically pure (because they store into memory).

  • frexp{f,l}
  • gamma{f,l}
  • gamma_r{f,l}
  • lgamma{f,l}
  • lgamma_r{f,l}
  • modf{f,l}
  • remquo{f,l}
  • sincos{f,l}

@n8sh
Copy link
Member

n8sh commented Apr 25, 2020

I think #2045 doesn't leave anything in core.stdc.math that can be marked pure unless the definition of pure is changed to allow changes to errno. IIRC Walter Bright has toyed with that idea in the past.

@Geod24
Copy link
Member

Geod24 commented Apr 25, 2020

unless the definition of pure is changed to allow changes to errno

I really hope we don't go in that direction. Logical pure would be as useful as logical const.

@ibuclaw
Copy link
Member

ibuclaw commented Apr 26, 2020

unless the definition of pure is changed to allow changes to errno

I really hope we don't go in that direction. Logical pure would be as useful as logical const.

Well pure+errno is the main reason why we do things ourselves in std.math over just forwarding to libm.

@dlang-bot dlang-bot added Needs Rebase needs a `git rebase` performed stalled labels May 27, 2021
@RazvanN7
Copy link
Contributor

Closing as per:

I think #2045 doesn't leave anything in core.stdc.math that can be marked pure unless the definition of pure is changed to allow changes to errno. IIRC Walter Bright has toyed with that idea in the past.

@RazvanN7 RazvanN7 closed this Aug 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Needs Rebase needs a `git rebase` performed stalled Trivial typos, formatting, comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants