#29 Silence some compilation warning (and fix some real bugs)

closed
Spacy
None
5
2006-08-25
2006-04-17
No

I downloaded the CVS version on 2006-04-17 and compiled
it on Debian GNU/Linux with GCC 4.1. The attached patch
adds missing newlines at end of files, removes unused
variables, fixes some signed/unsigned comparisons.

It also fixes some real bugs that were detected by the
compiler: assignment and increment of a same variable.
This is undefined: both modifying actions happen at the
same sequence point and hence their relative order is
not specified. So, depending on the compiler and the
optimization level, the behavior may change. For
example, as strange as it may seem, because of the
statement "rewindPos = ++rewindPos & 7;", the rewindPos
variable could go past 7. The fix is to replace
increments by additions.

Please apply. Thanks.

Discussion

  • Patch for silencing compiler warning

     
    Attachments
  • Spacy
    Spacy
    2006-08-25

    • assigned_to: nobody --> spacy51
    • status: open --> closed