ROHC library build emits warnings on x86-64

Bug #800835 reported by Didier Barvaux
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rohc
Status tracked in Rohc-main
1.2.x
Invalid
Undecided
Didier Barvaux
1.3.x
Invalid
Undecided
Didier Barvaux
Rohc-main
Fix Released
Low
Didier Barvaux

Bug Description

On a x86-64 system, building the ROHC library (trunk version) emits several warnings about wrong conversion specifications for variables of type size_t. Indeed %zd should be used instead of %d or %u for size_t variables.

Steps to reproduce:
1. Retrieve trunk sources
2. ./autogen.sh --enable-fail-on-warning --enable-rohc-debug --enable-rohc-tests
3. make clean all check

With the --enable-fail-on-warning flag, the build fails on all warnings.

Revision history for this message
Audric Schiltknecht (audric-schiltknecht) wrote :

%zu may be used if C99 is used to compile ROHC. (length modifier 'z' was added in C99, cf http://en.wikipedia.org/wiki/C99 or http://www.open-std.org/jtc1/sc22/WG14/www/docs/n1256.pdf page 352).

If compatibility with C90 is required, using '%lu', and casting any 'size_t' variables to 'unsigned long' is sufficient.

Provided patch uses '%lu' formater, compiles and passes tests successfully on both 32 and 64 bits plateforms (with GCC 4.6)

tags: added: portability
Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Branch 1.3.x is not affected.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

Branch 1.2.x is not affected.

Revision history for this message
Didier Barvaux (didier-barvaux) wrote :

The C99 standard is already required because of variadic macros. So, sorry Audric, I prefer using the %zd modifier.

Format strings modified all around in the trunk to fix the x68_64 build.
See http://bazaar.launchpad.net/~didier-barvaux/rohc/main/revision/256 for details.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.