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

Clean build warnings #584

Closed
egorpugin opened this issue Dec 15, 2016 · 7 comments
Closed

Clean build warnings #584

egorpugin opened this issue Dec 15, 2016 · 7 comments

Comments

@egorpugin
Copy link
Contributor

egorpugin commented Dec 15, 2016

Currently we see tons of warnings during MSVC builds.
They should be fixed during modernizing code phase.
See this log for warnings https://ci.appveyor.com/api/buildjobs/3v0vmv6xjy658f79/log

@stweil
Copy link
Member

stweil commented Dec 15, 2016

Similar warnings can be produced on Linux using clang++. But even the default debug build with gcc produces tons of warnings (mainly signed/unsigned mismatch).

@egorpugin
Copy link
Contributor Author

egorpugin commented Dec 15, 2016

I've also removed /W1 (warning level 1, default is 3) in leptonica for MSVC.
So, @DanBloomberg probably should look at those warnings in lept too.
https://ci.appveyor.com/api/buildjobs/0s1o3vud8x1e1pe6/log

@DanBloomberg
Copy link

DanBloomberg commented Dec 15, 2016

In leptonica:

  • 95% of these are because I use floats, and floating point numbers (like 1.0) are assumed to be doubles.
  • Most of the rest are implicit conversions from float to int, where the ints are indices into a 2d image array.

@egorpugin
Copy link
Contributor Author

  • 1.0 -> 1.0f
  • make casts explicit

What do you think?

@stweil
Copy link
Member

stweil commented Dec 15, 2016

Mixing float and double can result in additional code (and execution time) for conversions between both types.

@DanBloomberg
Copy link

Any program may do a few tens of these, so we're talking about a small fraction of a microsecond.

Eliminating these windows compiler warnings is not high on my todo list. I'll try to remember to add "f" to numbers in files that I'm modifying for other reasons.

@zdenop
Copy link
Contributor

zdenop commented Oct 16, 2018

Closing this, because more info is provided in #1036

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

5 participants