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

Overzealous narrowing warning now error #1374

Open
agcapps opened this issue Aug 29, 2024 · 0 comments
Open

Overzealous narrowing warning now error #1374

agcapps opened this issue Aug 29, 2024 · 0 comments
Assignees

Comments

@agcapps
Copy link

agcapps commented Aug 29, 2024

Vec<float32, 2> SS_triad_pos = {{0.1 * 2.0 - 1.0, 0.1 * 2.0 - 1.0}};

Here, my compiler errors out because e.g. 0.1 * 2.0 - 1.0 is a double literal getting stored as a float32. The compiler suggests using static_cast<float32>( ).

Grumpy, because I see no harm, but the compiler treats it as an error.

@cyrush cyrush self-assigned this Aug 29, 2024
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

No branches or pull requests

2 participants