Issue information

Issue ID
#6352
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Jul 28, 2012 14:08
Last Post
Hercules Elf Bot
Aug 1, 2012 15:43
Confirmation
N/A

Hercules Elf Bot - Jul 28, 2012 14:08

Originally posted by [b]onizame[/b]
[spoiler][CODE]battle.c: In function âbattle_attr_fixâ:
battle.c:359: warning: array subscript is above array bounds
battle.c: In function âbattle_calc_weapon_attackâ:
battle.c:1419: warning: array subscript is above array bounds
battle.c: In function âbattle_calc_magic_attackâ:
battle.c:3337: warning: array subscript is above array bounds[/CODE]

[CODE]pc.c: In function âpc_talisman_timerâ:
pc.c:8870: warning: array subscript is above array bounds
pc.c:8873: warning: array subscript is above array bounds[/CODE][/spoiler]

SVN 16520

Hercules Elf Bot - Jul 28, 2012 14:16

Originally posted by [b]malufett[/b]
sorry for that I'm not a Linux user that is why I'm not aware with the warnings..
based on my research its a bug in GCC..
[url="http://www.mathworks.com/support/solutions/en/data/1-D2Q3LW/index.html?product=SL&solution=1-D2Q3LW"]http://www.mathworks.com/support/solutions/en/data/1-D2Q3LW/index.html?product=SL&solution=1-D2Q3LW[/url]

anyway I'll try to find remedies for that or their devs can fixed that.. :)

This post has been edited by malufett on Jul 28, 2012 14:18

Hercules Elf Bot - Jul 28, 2012 14:48

Originally posted by [b]onizame[/b]
[quote name='malufett' timestamp='1343484989' post='12619']
sorry for that I'm not a Linux user that is why I'm not aware with the warnings..based on my research its a bug in GCC..[url="http://www.mathworks.com/support/solutions/en/data/1-D2Q3LW/index.html?product=SL&solution=1-D2Q3LW"]http://www.mathworks...lution=1-D2Q3LW[/url]anyway I'll try to find remedies for that or their devs can fixed that.. :)
[/quote]

eh.. its ok.. /abs that link contains alien language.. :P hope this is gonna be fixed.. tyvm

Hercules Elf Bot - Jul 29, 2012 2:01

Originally posted by [b]Ind[/b]
[s]I wasn't able to reproduce this[/s]
this makes sense actually. the talisman array seems to be wrongly setup, you set the minimum as 1 while it is 0 and the maximum as 6 while it is 4

This post has been edited by Ind on Jul 29, 2012 2:12

Hercules Elf Bot - Jul 29, 2012 2:48

Originally posted by [b]malufett[/b]
sir Ind it was intended...
I setup it 1 so that in the checking it will not used 0 since it will never be used...and for the 6 so that the final value will be 5 and can be used to terminate and for checking and consider 4 for its final used... :)

anyway I'll try to DL Cygwin to test it there to fix this warnings..^^

This post has been edited by malufett on Jul 29, 2012 3:53

Hercules Elf Bot - Jul 29, 2012 4:52

Originally posted by [b]Ind[/b]
[quote name='malufett' timestamp='1343530091' post='12659']
sir Ind it was intended...I setup it 1 so that in the checking it will not used 0 since it will never be used...and for the 6 so that the final value will be 5 and can be used to terminate and for checking and consider 4 for its final used... :)anyway I'll try to DL Cygwin to test it there to fix this warnings..^^
[/quote]
the array in pc.h is int[5], a [5] is 5 element array => [0][1][2][3][4] (you see, no [5]) so the correct would be either a int[6] or a maximum of 5 instead of 6 in the arr_find check

Hercules Elf Bot - Jul 29, 2012 11:10

Originally posted by [b]malufett[/b]
:)...yes I know sir...however if I use 5 as maximum I can't make the return variable to set five cause in it will terminate at 4..cause the ARR_FIND uses pre-increment...and a condition '<'...I forgot linux is more strict than windows...XD
anyway I'll just increase the index since the 5th amulet is existing but I don't know its use ATM... -_-

This post has been edited by malufett on Jul 29, 2012 14:27

Hercules Elf Bot - Jul 29, 2012 14:40

Originally posted by [b]malufett[/b]
Fixed @ [rev='16530']

Finally..thanks to sir Ind...