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

narrowing conversion of 'fmax #24865

Closed
lixiaowei123 opened this issue Sep 4, 2023 · 4 comments
Closed

narrowing conversion of 'fmax #24865

lixiaowei123 opened this issue Sep 4, 2023 · 4 comments

Comments

@lixiaowei123
Copy link

lixiaowei123 commented Sep 4, 2023

1693791706656

copter-4.3.8 build fmuv5/CUAV-X7. Compiling firmware shows an issue

/AP_Math/ftype.h:24:24: error: narrowing conversion of 'fmax(fmax(((double)magVar.Vector3::x), ((double)magVar.Vector3::y)), ((double)magVar.Vector3::z))' from 'double' to 'float' inside { } [-Werror=narrowing]
#define fmaxF(x,y) fmax(x,y)
^
../../libraries/AP_NavEKF3/AP_NavEKF3_Outputs.cpp:620:9: note: in expansion of macro 'fmaxF'
fmaxF(fmaxF(magVar.x,magVar.y),magVar.z),

@IamPete1
Copy link
Member

IamPete1 commented Sep 5, 2023

What is the output of your configure step?

@peterbarker
Copy link
Contributor

I think this looks like a valid warning; the mavlink_ekf_status_report_t we are assembling really only has room for a float but we're trying to shove a double in there (fmaxF sometimes doing that....).

We should not be using fmaxF there - the type is clearly float IMO. #24918

I am really interested in the output of that configure step which @IamPete1 requested!

@lixiaowei123
Copy link
Author

thank you,Gcc version issue

@IamPete1
Copy link
Member

Fixed by #24918

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