Skip to content

Forward compatibility with Erlang 27: distinguish between positive and negative 0.0 (backport #9405) #9407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 13, 2023

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Sep 12, 2023

This is an automatic backport of pull request #9405 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

mkuratczyk and others added 4 commits September 12, 2023 23:05
Without this change, our tests against OTP master started failing since
the negative zero change was introduced, for example:
https://github.com/rabbitmq/rabbitmq-server/actions/runs/6141080013/job/16660857916

The warning (treated as error) is:
```
rabbit_numerical.erl:33:8: matching on the float 0.0 will no longer also match -0.0 in OTP 27. If you specifically intend to match 0.0 alone, write +0.0 instead.
```

(cherry picked from commit ded9441)
for OTP 27 compatibility.

Without special casing 0.0, we end up with a
math:log10/1 call which is undefined for zero.

(cherry picked from commit 2f8473b)
(cherry picked from commit f805364)
…matching

Erlang 27 erlc requires us to match on both but earlier versions
complain that one head of the function is unreachable because the other
one always matches.

So we avoid pattern matching entirely.

(cherry picked from commit 5903ff6)
@michaelklishin michaelklishin merged commit c5883c6 into v3.12.x Sep 13, 2023
@michaelklishin michaelklishin deleted the mergify/bp/v3.12.x/pr-9405 branch September 13, 2023 01:55
michaelklishin added a commit that referenced this pull request Sep 13, 2023
Forward compatibility with Erlang 27: distinguish between positive and negative 0.0 (backport #9405) (backport #9407)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants