Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
03435 Compiling Minor Always Sep 10, 2009, 10:33 Sep 10, 2009, 13:30
Tester qmc2 View Status Public Platform SDLMAME
Assigned To hap Resolution Fixed OS Linux
Status [?] Resolved Driver
Version 0.133u5 Fixed in Version 0.134u1 Build I686
Summary 03435: gcc warning for src/emu/sound/ymf271.c with OPTIMIZE=3 on openSUSE 11.1 x86
Description On openSUSE 11.1 x86 I get the following warning (treated as an error) when compiling with OPTIMIZE=3:

cc1: warnings being treated as errors
src/emu/sound/ymf271.c: In function ‘device_start_ymf271’:
src/emu/sound/ymf271.c:1630: error: ‘plfo[3]’ may be used uninitialized in this function
src/emu/sound/ymf271.c:1630: note: ‘plfo[3]’ was declared here
make: *** [obj/sdl/mame/emu/sound/ymf271.o] Error 1
make: *** Waiting for unfinished jobs....

This is stupid, I know, but a simple initialization of the array works around the issue (on line 1630 of src/emu/sound/ymf271.c):

double plfo[4] = {0, 0, 0, 0};
Steps To Reproduce
Additional Information $ uname -a
Linux linux-a41b #1 SMP 2009-08-15 17:53:59 +0200 i686 i686 i386 GNU/Linux

$ gcc -v
Using built-in specs.
Target: i586-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib --libexecdir=/usr/lib --enable-languages=c,c++,objc,fortran,obj-c++,java,ada --enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 --enable-ssp --disable-libssp --with-bugurl= --with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap --with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --program-suffix=-4.3 --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=i586-suse-linux
Thread model: posix
gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux)

I don't get that warning on openSUSE 11.0 x64, which uses gcc 4.3.1.
Regression Version
Affected Sets / Systems
Attached Files
There are no relationship linked to this issue.
User avatar
Sep 10, 2009, 12:00
at the switch (i / (LFO_LENGTH/4)), add:
default: plfo[3]=0; assert(0); break;

does that fix the warning too?
User avatar
Senior Tester
Sep 10, 2009, 12:06
yeah, that works as well!
User avatar
Sep 10, 2009, 12:16
ok, thanks