patchmldonkey, a multi-networks file-sharing client - Patches: patch #4696, Fix some C compiler warnings

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #4696: Fix some C compiler warnings

Submitter:  spiralvoice <spiralvoice>
Submitted:  Sun 11 Dec 2005 02:20:51 AM UTC
   
 
Category:  Bug fixes Priority:  5 - Normal
Status:  Done Assigned to:  None
Open/Closed:  Closed

Tue 13 Dec 2005 12:47:29 PM UTC, comment #4: 

Applied 2005/12/13

spiralvoice <spiralvoice>
Group administrator
Tue 13 Dec 2005 12:42:07 PM UTC, comment #3: 

updated patch to fix only warnings from commonHasher_c.c and sha1_c.c

spiralvoice <spiralvoice>
Group administrator
Mon 12 Dec 2005 01:32:38 PM UTC, comment #2: 

most of the warnings are only cosmetic stuff, missed header Files or absence declarations.

i guess len should be an int64, but we need an OFF_T because the prototyp in os_stubs.h is used from both os_stubs_c.c and its changed due to the 2 GB Filesizebug on mingw.
What about cast it to an int64? it should be the right value

Schlumpf <schlumpf_>
Group Member
Sun 11 Dec 2005 06:46:57 PM UTC, comment #1: 

I think it is bad practice to try and suppress warnings by papering over real code problems.  The warnings go away, but the bad code doesn't, and there is no way to find this code in the future since the warning has been hidden.  Warnings can been good.

A variable named "len" with a size_t type implies that it can't be negative.  Making it 'signed' so that the warning goes away doesn't seem like the right fix nor does it improve the code, it just hides the error.

os_stubs_c:
Hiding the fact that fd & len are not ints, but forcing the cast for the fprintf output could make future debugging a very big pain since it is printing incorrect values.


z <zet>
Group Member
Sun 11 Dec 2005 02:20:51 AM UTC, original submission:  

These warnings are now removed:

src/config/unix/os_stubs_c.c: In function `os_ftruncate':
src/config/unix/os_stubs_c.c:81: warning: int format, different type arg (arg 4)
src/config/unix/os_stubs_c.c: In function `os_uname':
src/config/unix/os_stubs_c.c:135: warning: embedded `\0' in format

src/utils/lib/sha1_c.c: In function `sha1_hash':
src/utils/lib/sha1_c.c:245: warning: suggest parentheses around arithmetic in operand of |
src/utils/lib/sha1_c.c: In function `sha1_end':
src/utils/lib/sha1_c.c:261: warning: suggest parentheses around arithmetic in operand of |

src/utils/lib/charsetstubs.c: In function `utf8_validate':
src/utils/lib/charsetstubs.c:191: warning: comparison of unsigned expression < 0 is always false
src/utils/lib/charsetstubs.c:191: warning: comparison between signed and unsigned
src/utils/lib/charsetstubs.c:203: warning: comparison of unsigned expression >= 0 is always true
src/utils/lib/charsetstubs.c:204: warning: comparison between signed and unsigned
src/utils/lib/charsetstubs.c:227: warning: comparison of unsigned expression >= 0 is always true
src/utils/lib/charsetstubs.c:230: warning: comparison of unsigned expression < 0 is always false
src/utils/lib/charsetstubs.c: In function `ml_convert_with_iconv':
src/utils/lib/charsetstubs.c:1225: warning: comparison of unsigned expression < 0 is always false
src/utils/lib/charsetstubs.c:1273: warning: comparison between signed and unsigned

src/daemon/common/commonHasher_c.c: In function `ml_job_start':
src/daemon/common/commonHasher_c.c:385: warning: implicit declaration of function `caml_enter_blocking_section'
src/daemon/common/commonHasher_c.c:391: warning: implicit declaration of function `caml_leave_blocking_section'

spiralvoice <spiralvoice>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #4129:  4696.patch added by spiralvoice (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-12-13 spiralvoice StatusNone Done
    Open/ClosedOpen Closed
2005-12-13 spiralvoice Attached File- Added 4696.patch, #5587
2005-12-13 spiralvoice Attached File#5577 Removed
2005-12-11 spiralvoice Attached File- Added c.patch, #5577

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code