Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings about printf variable size using GCC 4.5.1 #3

Open
GoogleCodeExporter opened this issue Jan 20, 2016 · 1 comment
Open

Warnings about printf variable size using GCC 4.5.1 #3

GoogleCodeExporter opened this issue Jan 20, 2016 · 1 comment

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant