[Bug 436030] New: Warning "array subscript is above array bounds" from gcc with -O3
https://bugzilla.novell.com/show_bug.cgi?id=436030 User Ralf.Klingebiel@kisters.de added comment https://bugzilla.novell.com/show_bug.cgi?id=436030#c1 Summary: Warning "array subscript is above array bounds" from gcc with -O3 Product: openSUSE 11.1 Version: Factory Platform: i586 OS/Version: openSUSE 11.0 Status: NEW Severity: Normal Priority: P5 - None Component: Development AssignedTo: pth@novell.com ReportedBy: Ralf.Klingebiel@kisters.de QAContact: qa@suse.de Found By: --- When compiling this: extern int printf (__const char *__restrict __format, ...); static int f2(char formatstr[10][100]) { int anz; for( anz = 0; anz < 10; ++anz ) { printf( "%d %s\n", anz, formatstr[anz] ); } return anz; } static char formatstr[10][100]; int main( void ) { int anz; anz = f2(formatstr); printf( " %d\n",anz); return 0; } with this command: cc -Wall gcc.c -O3 this happens: gcc.c: In function 'main': gcc.c:7: warning: array subscript is above array bounds gcc.c:7: warning: array subscript is above array bounds gcc.c:7: warning: array subscript is above array bounds gcc.c:7: warning: array subscript is above array bounds gcc.c:7: warning: array subscript is above array bounds gcc.c:7: warning: array subscript is above array bounds gcc.c:7: warning: array subscript is above array bounds gcc.c:7: warning: array subscript is above array bounds with this system: Using built-in specs. Target: i586-suse-linux Configured with: ../configure --prefix=/usr --with-local-prefix=/usr/local --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=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --program-suffix=-4.3 --enable-version-specific-runtime-libs --enable-linux-futex --without-system-libunwind --with-cpu=generic --build=i586-suse-linux Thread model: posix gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) Linux capella 2.6.25.5-1.1-pae #1 SMP 2008-06-07 01:55:22 +0200 i686 i686 i386 GNU/Linux -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=436030
Philipp Thomas
https://bugzilla.novell.com/show_bug.cgi?id=436030
User rguenther@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=436030#c1
Richard Guenther
participants (1)
-
bugzilla_noreply@novell.com