benzea / ptpv2d

Automatically exported from code.google.com/p/ptpv2d
2 stars 0 forks source link

Warnings about printf variable size using GCC 4.5.1 #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
2. svn co (current version)
3. make

What is the expected output? What do you see instead?
During compilation I get tons of warnings in protocol.c and net.c:
"warning: format ‘%d’ expects type ‘int’, but argument XXX has type 
‘ssize_t’"

What version of the product are you using? On what operating system?
Using Fedora Linux 14.x86_64, GCC 4.5.1, gmake 3.82, subversion 1.6.16
svn info: Revision: 27

Please provide any additional information below.
I fixed all warning using %zd or %zu instead of %d and %u when displaying 
ssize_t and size_t.
Attached file: in ptpv2d-dev: svn di > fixed-warnings-rev27.diff

Original issue reported on code.google.com by czing...@gmail.com on 31 May 2011 at 9:56

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the change.  I'll take a look at this.

This could also probably be fixed by casting ssize_t and size_t variables to 
"long" or "long long" based on precision of the desired output, 32 or 64 bit.

Before making the change I want to look at what Windows supports for printf as 
I'm trying to keep as much as possible common.

Apologies for not responding sooner as I've been mostly focusing comments and 
responses from the ptpv2d google code group.  To join, go to the page, enter 
the info and please make sure you give a short description that you are working 
on ptpv2d (so I can filter out junk mailers).

Thanks,

Alan

Original comment by a...@bartky.net on 9 Jul 2011 at 11:58