Giter VIP home page Giter VIP logo

Comments (3)

DanBloomberg avatar DanBloomberg commented on August 16, 2024 3

Thank you for looking at this. I am impressed with your command :-)

I happened to go through this list a few days ago. With one notable exception these are not problematic. The unused variables are behind preprocessor walls, so the compiler doesn't see their use. The set but unused variables are mostly there to avoid other warnings about ignoring returned data; many of these variables are called "ignore". The 2 unused functions have been used in the past and can be used for debugging or making some data if necessary.

The misleading indentation is a bug I introduced (an extra ';') while fixing stuff yesterday (!)
It's in a unit (partify) that is not working properly yet, so this isn't important.

Finally, the use after free is an error in gplot.c. It's in a section of code that is only invoked if there is an error opening a stream, which would be very rare. This will be fixed in a day or two.

from leptonica.

stweil avatar stweil commented on August 16, 2024 1

Even more warnings are produced with clang and compiler option -Weverything:

  18 [-Waddress-of-packed-member]
  96 [-Watomic-implicit-seq-cst]
  39 [-Wbad-function-cast]
  11 [-Wcast-align]
  31 [-Wcast-qual]
   3 [-Wcomma]
 189 [-Wconditional-uninitialized]
   3 [-Wdeclaration-after-statement]
  18 [-Wdisabled-macro-expansion]
   5 [-Wdocumentation-html]
   4 [-Wdocumentation-unknown-command]
1887 [-Wdocumentation]
2118 [-Wdouble-promotion]
   1 [-Wempty-translation-unit]
 158 [-Wfloat-conversion]
  35 [-Wfloat-equal]
   4 [-Wformat-nonliteral]
   5 [-Wformat-pedantic]
1008 [-Wimplicit-float-conversion]
 554 [-Wimplicit-int-conversion]
   1 [-Wliteral-conversion]
   1 [-Wliteral-range]
   2 [-Wmissing-noreturn]
   2 [-Wmissing-prototypes]
  30 [-Wmissing-variable-declarations]
  11 [-Woverlength-strings]
  46 [-Wpadded]
  11 [-Wshadow]
   1 [-Wshift-sign-overflow]
 165 [-Wshorten-64-to-32]
 171 [-Wsign-compare]
1080 [-Wsign-conversion]
   7 [-Wstrict-prototypes]
   1 [-Wunaligned-access]
  13 [-Wundef]
   9 [-Wunreachable-code-break]
   1 [-Wunreachable-code-return]
   8 [-Wunreachable-code]
  25 [-Wunused-but-set-variable]
   1 [-Wunused-const-variable]
   2 [-Wunused-function]
  33 [-Wunused-macros]
 127 [-Wunused-parameter]
  15 [-Wunused-variable]

Some of them are worth being fixed, for example unnecessary conversions between float and double which cost a little bit of performance.

from leptonica.

DanBloomberg avatar DanBloomberg commented on August 16, 2024

That list looks like a warning not to get out of bed in the morning because 1000 bad things could happen. Or even worse, you might waste a year of your life chasing down compiler warnings ;-)

Never thought about overhead from float to double conversion. I have used float wherever possible because it saves storage and it used to be faster. So only used double if the precision was necessary (e.g., representing 32 bit integers, transforms near singularities, hashing functions, etc).

from leptonica.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.