-
Notifications
You must be signed in to change notification settings - Fork 15
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
Consider inserting explicit casts where appropriate #6
Comments
A similar scenario exists in a number of places for The code should have an explicit cast to show this conversion is intended. |
For other scenarios involving more complex expressions (such as https://github.com/amd/aocl-libm-ose/blob/aocl-3.0/src/fast/powf.c#L304) it is also unclear where the cast was intended. In the above case, the logic is: |
Other cases such as https://github.com/amd/aocl-libm-ose/blob/aocl-3.0/src/fast/powf.c#L314-L315 are doing: double = int;
float = asfloat((uint32_t)double) In particular, it isn't clear if the intent is to:
|
double
to float
where appropriate
https://github.com/amd/aocl-libm-ose/blob/aocl-3.0/src/optmized/cos.c#L230 has an implicit cast from |
Various bits of code, such as https://github.com/amd/aocl-libm-ose/blob/aocl-3.0/src/fast/powf.c#L255, currently have implicit casts from
double
tofloat
.The code should likely be updated to either use the float variant of the method (such as
sqrtf
in the above case) or to explicitly cast tofloat
so the compiler doesn't warn.The text was updated successfully, but these errors were encountered: