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

Compiler warning signalling_nan<double> for bool #5278

Closed
anne-glerum opened this issue Jul 12, 2023 · 2 comments
Closed

Compiler warning signalling_nan<double> for bool #5278

anne-glerum opened this issue Jul 12, 2023 · 2 comments
Assignees

Comments

@anne-glerum
Copy link
Contributor

On Mac I get the following compiler warnings:

number into integer: 'double' to 'bool' [-Wfloat-conversion]
plastic_yielding = numbers::signaling_nan<double>();
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/ASPECT/VisualStudioCode/aspect/source/material_model/visco_plastic.cc:263:34: warning: implicit conversion turns floating-point number into integer: 'double' to 'bool' [-Wfloat-conversion]
plastic_yielding = numbers::signaling_nan<double>();
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/ASPECT/VisualStudioCode/aspect/source/material_model/visco_plastic.cc:446:36: note: in instantiation of member function 'aspect::MaterialModel::ViscoPlastic<2>::evaluate' requested here
ASPECT_REGISTER_MATERIAL_MODEL(ViscoPlastic,
^
/Applications/ASPECT/VisualStudioCode/aspect/source/material_model/visco_plastic.cc:263:34: warning: implicit conversion turns floating-point number into integer: 'double' to 'bool' [-Wfloat-conversion]
plastic_yielding = numbers::signaling_nan<double>();
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

plastic_yielding is a boolean, but it's initialized with a signaling_nan. Is there another signal that it can be initialized with?

@gassmoeller
Copy link
Member

Could you check if this still happens with latest main? It should have been fixed with #5257.

@anne-glerum
Copy link
Contributor Author

Yep, doesn't happen with latest main, never mind!

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

3 participants