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

[build] Fix -Wconversion double-to-float truncation warnings #1937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oznogon
Copy link
Contributor

@oznogon oznogon commented Mar 10, 2023

A build with the -Wconversion compiler flag generates 97 float-conversion double-to-float truncation warnings in GCC, such as:

EmptyEpsilon/src/beamTemplate.cpp:16:26:
warning:
conversion from ‘double’ to ‘float’ changes value from ‘2.0e-2’ to ‘1.99999996e-2f’
[-Wfloat-conversion]

This PR f-suffixes decimal numbers generating these warnings to make them explicitly floats, and others that aren't generating warnings but are inconsistently presented near changed values.

Values aren't changed, only suffixed.

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.

None yet

1 participant