[PATCH] libdvdread/src/ifo_read.c: Format fraction as float and update error message
Date: Mon, 18 Nov 2013 16:54:51 +0100 GCC 4.8.2 and Clang 3.4 both warn about a format mismatch. libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o ifo_read.c: In function 'ifoRead_TT_SRPT': ifo_read.c:1078:13: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat=] info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts); libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o ifo_read.c:1078:13: warning: format specifies type 'long' but the argument has type 'unsigned int' [-Wformat] info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fix this by actually displaying the float value and by updating the error message. --- libdvdread/src/ifo_read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libdvdread/src/ifo_read.c b/libdvdread/src/ifo_read.c index 36545ce..5640e0a 100644 --- a/libdvdread/src/ifo_read.c +++ b/libdvdread/src/ifo_read.c @@ -1074,8 +1074,8 @@ int ifoRead_TT_SRPT(ifo_handle_t *ifofile) { } if(tt_srpt->nr_of_srpts>info_length/sizeof(title_info_t)){ - fprintf(stderr,"libdvdread: data mismatch: info_length (%ld)!= nr_of_srpts (%d). Truncating.\n", - info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts); + fprintf(stderr,"libdvdread: data mismatch: info_length/sizeof(title_info_t) (%f)!= nr_of_srpts (%d). Truncating.\n", + info_length * 1.0/sizeof(title_info_t),tt_srpt->nr_of_srpts); tt_srpt->nr_of_srpts=info_length/sizeof(title_info_t); } -- 1.8.4.3
Hi Paul, On Monday, 18 November 2013 at 17:25, Paul Menzel wrote:
Date: Mon, 18 Nov 2013 16:54:51 +0100
GCC 4.8.2 and Clang 3.4 both warn about a format mismatch.
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o ifo_read.c: In function 'ifoRead_TT_SRPT': ifo_read.c:1078:13: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'unsigned int' [-Wformat=] info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts);
libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o ifo_read.c:1078:13: warning: format specifies type 'long' but the argument has type 'unsigned int' [-Wformat] info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sorry, but I don't get this warning: /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c -o ifo_read.lo ifo_read.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o ifo_read.c: In function 'ifoRead_PTL_MAIT': ifo_read.c:1307:34: warning: comparison between pointer and integer [enabled by default] if(ifofile->vmgi_mat->ptl_mait == NULL) ^ mv -f .deps/ifo_read.Tpo .deps/ifo_read.Plo What distribution is this and what are the exact steps you performed after unpacking the tarball? What are your versions of autoconf, automake and libtool? Regards, Dominik -- Fedora http://fedoraproject.org/wiki/User:Rathann RPMFusion http://rpmfusion.org | MPlayer http://mplayerhq.hu "Faith manages." -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
On Dec 4, 2013 2:39 PM, "Dominik 'Rathann' Mierzejewski" < dominik@greysector.net> wrote:
Hi Paul,
On Monday, 18 November 2013 at 17:25, Paul Menzel wrote:
Date: Mon, 18 Nov 2013 16:54:51 +0100
GCC 4.8.2 and Clang 3.4 both warn about a format mismatch.
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src
ifo_read.c: In function 'ifoRead_TT_SRPT': ifo_read.c:1078:13: warning: format '%ld' expects argument of
type 'long int', but argument 3 has type 'unsigned int' [-Wformat=]
info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts);
libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -I.. -I../src
-O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o
ifo_read.c:1078:13: warning: format specifies type 'long' but
-mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o the argument has type 'unsigned int' [-Wformat]
info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sorry, but I don't get this warning: /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c -o ifo_read.lo ifo_read.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o ifo_read.c: In function 'ifoRead_PTL_MAIT': ifo_read.c:1307:34: warning: comparison between pointer and integer [enabled by default] if(ifofile->vmgi_mat->ptl_mait == NULL) ^ mv -f .deps/ifo_read.Tpo .deps/ifo_read.Plo
What distribution is this and what are the exact steps you performed after unpacking the tarball? What are your versions of autoconf, automake and libtool?
Did you see that it was clang? Timothy
On Dec 4, 2013 6:02 PM, "Timothy Gu" <timothygu99@gmail.com> wrote:
On Dec 4, 2013 2:39 PM, "Dominik 'Rathann' Mierzejewski" <
Hi Paul,
On Monday, 18 November 2013 at 17:25, Paul Menzel wrote:
Date: Mon, 18 Nov 2013 16:54:51 +0100
GCC 4.8.2 and Clang 3.4 both warn about a format mismatch.
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src
-mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o
ifo_read.c: In function 'ifoRead_TT_SRPT': ifo_read.c:1078:13: warning: format '%ld' expects argument of
type 'long int', but argument 3 has type 'unsigned int' [-Wformat=]
info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts);
libtool: compile: clang -DHAVE_CONFIG_H -I. -I.. -I..
-I../src -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o
ifo_read.c:1078:13: warning: format specifies type 'long' but
dominik@greysector.net> wrote: the argument has type 'unsigned int' [-Wformat]
info_length/sizeof(title_info_t),tt_srpt->nr_of_srpts);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sorry, but I don't get this warning: /bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c -o ifo_read.lo ifo_read.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -mno-ms-bitfields -O3 -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -MT ifo_read.lo -MD -MP -MF .deps/ifo_read.Tpo -c ifo_read.c -fPIC -DPIC -o .libs/ifo_read.o ifo_read.c: In function 'ifoRead_PTL_MAIT': ifo_read.c:1307:34: warning: comparison between pointer and integer [enabled by default] if(ifofile->vmgi_mat->ptl_mait == NULL) ^ mv -f .deps/ifo_read.Tpo .deps/ifo_read.Plo
What distribution is this and what are the exact steps you performed after unpacking the tarball? What are your versions of autoconf, automake and libtool?
Did you see that it was clang?
Never mind. Sorry! Timothy
participants (3)
-
Dominik 'Rathann' Mierzejewski -
Paul Menzel -
Timothy Gu