Bug 3011 - Format string not matching arguments
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Misc
Version: 1.33 SVN
Hardware: Other Linux
: P2 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2007-01-24 12:15 EST by Thilo Schulz
Modified: 2007-05-21 11:27:19 EDT
0 users

See Also:


Attachments
Fix various with format strings and arguments (9.21 KB, patch)
2007-01-24 12:46 EST, Thilo Schulz
unfixed warning (9.54 KB, patch)
2007-01-24 13:16 EST, Thilo Schulz

Description Thilo Schulz 2007-01-24 12:15:11 EST
Since I've started using gcc-4.1.1 I get a couple of warnings like:

code/server/sv_client.c:713: warning: format '%d' expects type 'int', but argument 2 has type 'long int'
code/server/sv_client.c:717: warning: format '%d' expects type 'int', but argument 2 has type 'long int'
code/server/sv_client.c:717: warning: format '%d' expects type 'int', but argument 2 has type 'long int'

from my compiler. If the size of an argument given in the format string doesn't match the actual size this could turn out ugly when subsequent arguments are pointers to strings.
Comment 1 Thilo Schulz 2007-01-24 12:46:34 EST
Created attachment 1241 [details]
Fix various with format strings and arguments

This patch fixes all of these warnings. In many cases, these were justified and would lead to false output or even to a crash.
Comment 2 Thilo Schulz 2007-01-24 12:47:42 EST
oh and I'm wondering whether the %p conversion specifier exists on more exotic platforms like solaris. Shouldn't be a problem though.
Comment 3 Thilo Schulz 2007-01-24 13:16:30 EST
Created attachment 1242 [details]
unfixed warning

woops, still forgot one warning
Comment 4 Thilo Schulz 2007-01-24 16:23:42 EST
committed
Comment 5 Ryan C. Gordon 2007-05-21 11:27:19 EDT
Setting a QA contact on all ioquake3 bugs, even resolved ones. Sorry if you get a flood of email from this, it should only happen once. Apologies for the incovenience.

--ryan.