Skip to content
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

Fix clang warning and potential overflow #984

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

bettio
Copy link
Collaborator

@bettio bettio commented Dec 12, 2023

clang was reporting:
error: implicit conversion from 'long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-const-int-float-conversion]

This change fixes that warning.

Also, there was an (unlikely) overflow with functions such as erlang:ceil/1, since the check was wrong due to that precision loss.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

clang was reporting:
`error: implicit conversion from 'long' to 'double' changes value from
9223372036854775807 to 9223372036854775808
[-Werror,-Wimplicit-const-int-float-conversion]`

This change fixes that warning.

Also, there was an (unlikely) overflow with functions such as
`erlang:ceil/1`, since the check was wrong due to that precision loss.

Signed-off-by: Davide Bettio <davide@uninstall.it>
Copy link
Collaborator

@UncleGrumpy UncleGrumpy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me.

@bettio bettio merged commit 77bec5d into atomvm:master Dec 13, 2023
84 of 85 checks passed
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.

3 participants