OS X 10.8.4 "make" command generates warnings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| pbzip2 |
Low
|
Yavor Nikolov |
Bug Description
Doing a make in OS X 10.8.4 generates some warnings that look potentially problematic since they are variable size issues.. Particular in BZ2StreamScanne
output:
$ make
g++ -O2 -D_LARGEFILE64_
pbzip2.cpp:2999:99: warning: format specifies type 'unsigned int' but the argument has type 'size_t'
(aka 'unsigned long') [-Wformat]
pbzip2.cpp:3943:79: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
...fprintf(
pbzip2.cpp:4428:92: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
...limit increased to %d MB to support %d CPUs\n", ((NumBufferedBl
3 warnings generated.
BZ2StreamScanne
BZ2StreamScanne
BZ2StreamScanne
BZ2StreamScanne
4 warnings generated.
Configuration information:
For: pbzip2-1.1.6
iMac Core i5, OS X 10.8.4
$ g++ --version
Configured with: --prefix=
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)
Target: x86_64-
Thread model: posix
Related branches
- Yavor Nikolov: Approve on 2014-04-13
-
Diff: 474 lines (+71/-63)5 files modifiedBZ2StreamScanner.cpp (+15/-13)
BZ2StreamScanner.h (+2/-0)
ChangeLog (+1/-0)
pbzip2.cpp (+50/-50)
pbzip2.h (+3/-0)
Yavor Nikolov (yavor-nikolov) wrote : | #1 |
haikuty (tyler-q) wrote : | #2 |
Ah, sorry. I didn't see that there was a newer version because I found pbzip2 here: http://
Yes, that stack overflow answer does seem like the right answer.
Version 1.1.8 seems to have the same issues:
$ make
g++ -O2 -D_LARGEFILE64_
pbzip2.cpp:3071:99: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
pbzip2.cpp:4003:79: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long' [-Wformat]
pbzip2.cpp:4494:92: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
...fprintf(
3 warnings generated.
BZ2StreamScanne
BZ2StreamScanne
BZ2StreamScanne
BZ2StreamScanne
4 warnings generated.
I changed it to use the type safe version as per that SO post and this took care of the compiler warnings. Here's the diff output for the changes to 1.1.8 to remove the warnings (sorry don't have bzr and doesn't look like something worth installing/learning at this point since it appears to be dying slowly):
-----...
Jeff Gilchrist (jeff-gilchrist) wrote : Re: [Bug 1236086] Re: OS X 10.8.4 "make" command generates warnings | #3 |
On Mon, Oct 7, 2013 at 1:51 AM, haikuty <email address hidden> wrote:
> Ah, sorry. I didn't see that there was a newer version because I found
> pbzip2 here: http://
> listed there is the 1.1.6 I used.
Wow, I didn't realize the website was two versions behind, I will have
to fix that ASAP. Sorry about that.
Jeff.
Changed in pbzip2: | |
assignee: | nobody → Yavor Nikolov (yavor-nikolov) |
milestone: | none → 1.1.9 |
status: | New → In Progress |
Changed in pbzip2: | |
importance: | Undecided → Low |
status: | In Progress → Fix Committed |
Changed in pbzip2: | |
status: | Fix Committed → Fix Released |
Thanks for reporting this. Is the same reproducible with version 1.1.8?
(These printf statements shouldn't be something critical. Yet - good if we can make it a bit cleaner).
This behaviour depends on compiler (32 or 64-bit and other details). Needs some thinking to figure out what would be the best way to adress the issue. stackoverflow. com/questions/ 2524611/ how-to- print-size- t-variable- portably
A discussion on similar topic is here: http://