Bugzilla – Bug 152088
sarien-0.7.0-885: array subscript out of range
Last modified: 2007-01-16 22:17:00 UTC
I just tried to compile package sarien-0.7.0-885 with the Intel C compiler. It said op_cmd.c(650): warning #175: subscript out of range The source code is _v[p1] = atoi (game.strings[MAX_WORDS2]); but linux:/usr/src/packages/SPECS # find ../BUILD/sarien-0.7.0/ -name \*.h -print | xargs fgrep "strings[" ../BUILD/sarien-0.7.0/src/include/agi.h: char strings[MAX_WORDS1][MAX_WORDS2]; /**< strings */ and linux:/usr/src/packages/SPECS # find ../BUILD/sarien-0.7.0/ -name \*.h -print | xargs grep "define.*MAX_WORDS" ../BUILD/sarien-0.7.0/src/include/sarien.h:#define MAX_WORDS 20 ../BUILD/sarien-0.7.0/src/include/sarien.h:#define MAX_WORDS1 24 ../BUILD/sarien-0.7.0/src/include/sarien.h:#define MAX_WORDS2 41 /* Last string is used by get.num */ so it seems that the program is trying to index 41 into an array of size 24. Suggest code rework.
same here -> http://sarien.sourceforge.net/ latest CVS change is from 6day ago.
I am able to confirm that this bug still exists in Suse Linux 10.1
So please report it upstream!
(In reply to comment #3) > So please report it upstream! Thanks for your kind offer, but I don't think I'll bother. It looks to me like I will need Yet Another Account On Yet Another Project to report this, and for one bug report, for me it is not worth the bother. Feel free to report it yourself if you like. You may even already have an account with the Sarien project.
Still broken on Suse Linux 10.2 Beta 1.
Can this warning be reproduced with gcc?
d binderman <dcb314@hotmail.com> wrote: "What I wanted to say was that gcc finds no problem, but if gcc bug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8268 ever gets fixed, then it will."
Ok. Let me know, when the gcc bug is fixed. I then can open a bugreport to make these warnings even fatal for a package build and close this one as duplicate.
*** This bug has been marked as a duplicate of bug 235591 ***