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 warning #1

Open
GoogleCodeExporter opened this issue Apr 18, 2016 · 4 comments
Open

narrowing conversion warning #1

GoogleCodeExporter opened this issue Apr 18, 2016 · 4 comments

Comments

@GoogleCodeExporter
Copy link

is there a PRAGMA one can use to prevent these 'narrowing conversion' warnings?

Thanks,
Whit

this is gcc 4.6 on debian testing:

../cppbugs/fastexp.h:71:76: error: narrowing conversion of ‘((clipp + 
1.2694269561767578125e+2f) * 8.388608e+6f)’ from ‘float’ to ‘uint32_t 
{aka unsigned int}’ inside { } [-fpermissive]

Original issue reported on code.google.com by [email protected] on 30 Jan 2012 at 10:06

@GoogleCodeExporter
Copy link
Author

Yeah, that seems annoying.

This suggests static_cast is the fix.  
http://stackoverflow.com/questions/4434140/narrowing-conversions-in-c0x-is-it-ju
st-me-or-does-this-sound-like-a-breakin

Original comment by [email protected] on 31 Jan 2012 at 2:59

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Please notice that with clang these warnings become errors.

Original comment by [email protected] on 7 Apr 2013 at 8:49

@GoogleCodeExporter
Copy link
Author

I thought this was fixed (I added cast.h and sprinkled the code appropriately 
with casting operators).  I'm using gcc 4.6.3 and not seeing this.  Do you have 
the latest version of the software?

Original comment by [email protected] on 7 Apr 2013 at 11:33

@GoogleCodeExporter
Copy link
Author

I think this isn't fixed completely. I'm testing using the latest release. On a 
Mac OS 10.9, ./configure && make check fails because clang treat those warnings 
as errors.

Original comment by [email protected] on 15 Jul 2014 at 5:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant