[opus] opusfile, compiler warnings

Ozkan Sezer sezeroz at gmail.com
Wed Jul 17 04:10:28 PDT 2013


Just a report about compiler warnings generated when building opusfile
from current git.  Regards.

# x86-Linux builds / gcc48 and clang-3.3
(no warnings)

# x86-Linux builds / gcc34

src/opusfile.c: In function `op_calc_bitrate':
src/opusfile.c:1777: warning: integer constant is too large for "long" type
src/opusfile.c: In function `op_open2':
src/opusfile.c:1131: warning: 'end_offset' might be used uninitialized
in this function

$ x86-Linux builds / gcc-2.95.4

src/opusfile.c: In function `op_bisect_forward_serialno':
src/opusfile.c:1131: warning: `end_offset' might be used uninitialized
in this function
src/opusfile.c: In function `op_calc_bitrate':
src/opusfile.c:1777: warning: integer constant out of range

# x86-Linux builds / gcc-4.4.7
src/opusfile.c: In function 'op_calc_bitrate':
src/opusfile.c:1777: warning: integer constant is too large for 'long' type

## Mac OS X ppc and x86 builds (against 10.4 SDK)
## additional CFLAGS used: -fno-common -force_cpusubtype_ALL
$ ./powerpc-apple-darwin9-gcc -v
Using built-in specs.
Target: powerpc-apple-darwin9
Configured with: ../gcc_40-5494/configure --prefix=/opt/cross_osx-ppc
--disable-checking --enable-languages=c,objc,c++,obj-c++
--with-as=/opt/cross_osx-ppc/bin/powerpc-apple-darwin9-as
--with-ld=/opt/cross_osx-ppc/bin/powerpc-apple-darwin9-ld
--target=powerpc-apple-darwin9 --with-sysroot=/opt/cross_osx-ppc
--enable-static --enable-shared --disable-nls --disable-multilib
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5494)

$ ./i686-apple-darwin9-gcc -v
Using built-in specs.
Target: i686-apple-darwin9
Configured with: ../gcc_40-5494/configure --prefix=/opt/cross_osx-x86
--disable-checking --enable-languages=c,objc,c++,obj-c++
--with-as=/opt/cross_osx-x86/bin/i686-apple-darwin9-as
--with-ld=/opt/cross_osx-x86/bin/i686-apple-darwin9-ld
--target=i686-apple-darwin9 --with-sysroot=/opt/cross_osx-x86
--enable-static --enable-shared --disable-nls --disable-multilib
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5494)

src/opusfile.c: In function 'op_calc_bitrate':
src/opusfile.c:1777: warning: integer constant is too large for 'long' type
src/opusfile.c: In function 'op_open2':
src/opusfile.c:320: warning: 'preferred_sr.gp' may be used
uninitialized in this function
src/opusfile.c:320: warning: 'preferred_sr.serialno' may be used
uninitialized in this function
src/opusfile.c:320: warning: 'preferred_sr.size' may be used
uninitialized in this function
src/opusfile.c:320: warning: 'preferred_sr.offset' may be used
uninitialized in this function
src/opusfile.c:320: warning: 'preferred_sr.search_start' may be used
uninitialized in this function
src/opusfile.c:1131: warning: 'end_offset' may be used uninitialized
in this function
src/opusfile.c: In function 'op_pcm_seek':
src/opusfile.c:2417: warning: 'li' may be used uninitialized in this function

## Mac OS X x86_64 builds (against 10.6 SDK)
## additional CFLAGS used: -fno-common -force_cpusubtype_ALL
-mmacosx-version-min=10.5
## additional LDFLAGS used: -mmacosx-version-min=10.5
$ ./x86_64-apple-darwin9-gcc -v
Using built-in specs.
Target: x86_64-apple-darwin9
Configured with: ../gcc-5666.3/configure
--prefix=/opt/cross_osx-x86_64/usr --disable-checking
--enable-languages=c,objc,c++,obj-c++
--with-as=/opt/cross_osx-x86_64/usr/bin/x86_64-apple-darwin9-as
--with-ld=/opt/cross_osx-x86_64/usr/bin/x86_64-apple-darwin9-ld64
--target=x86_64-apple-darwin9 --with-sysroot=/opt/cross_osx-x86_64
--enable-static --enable-shared --enable-nls --disable-multilib
--disable-werror --enable-libgomp
--with-gxx-include-dir=/opt/cross_osx-x86_64/usr/include/c++/4.2.1
--with-ranlib=/opt/cross_osx-x86_64/usr/bin/x86_64-apple-darwin9-ranlib
--with-lipo=/opt/cross_osx-x86_64/usr/bin/x86_64-apple-darwin9-lipo
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)

src/opusfile.c: In function ‘op_open2’:
src/opusfile.c:320: warning: ‘preferred_sr.gp’ may be used
uninitialized in this function
src/opusfile.c:320: note: ‘preferred_sr.gp’ was declared here
src/opusfile.c:320: warning: ‘preferred_sr.serialno’ may be used
uninitialized in this function
src/opusfile.c:320: note: ‘preferred_sr.serialno’ was declared here
src/opusfile.c:320: warning: ‘preferred_sr.size’ may be used
uninitialized in this function
src/opusfile.c:320: note: ‘preferred_sr.size’ was declared here
src/opusfile.c:320: warning: ‘preferred_sr.offset’ may be used
uninitialized in this function
src/opusfile.c:320: note: ‘preferred_sr.offset’ was declared here
src/opusfile.c:320: warning: ‘preferred_sr.search_start’ may be used
uninitialized in this function
src/opusfile.c:320: note: ‘preferred_sr.search_start’ was declared here
src/opusfile.c:1131: warning: ‘end_offset’ may be used uninitialized
in this function
src/opusfile.c:1131: note: ‘end_offset’ was declared here


--
O.S.


More information about the opus mailing list