ferd / recon

Collection of functions and scripts to debug Erlang in production.
http://ferd.github.io/recon/
BSD 3-Clause "New" or "Revised" License
1.37k stars 278 forks source link

remove compilation warning in OTP26.1 #107

Closed gonzalobf closed 1 year ago

gonzalobf commented 1 year ago

In OTP-27, +0.0 and -0.0 will no longer be the exact number so they added a compilation warning in OTP-26.1 to warn when a float 0.0 is getting match without specifying the sign:

rebar3 compile                                                                                                                                                                               0s
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling recon
src/recon_alloc.erl:706:7: Warning: 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.
src/recon_alloc.erl:706:11: Warning: 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.

Longer explanation about why are not the same [1]

Pull request adding the warning [2]

[1] https://erlangforums.com/t/in-erlang-otp-27-0-0-will-no-longer-be-exactly-equal-to-0-0/2586 [2] https://github.com/erlang/otp/pull/7521