Skip to content

Commit 70fd7cd

Browse files
committed
ccstruct: Fix compiler warning (disable buggy code)
gcc reports a potential bad array access: ccstruct/mod128.cpp:98:20: warning: array subscript has type 'char' [-Wchar-subscripts] dir is of type 'char'. Most compilers use signed char by default. Then the value of dir is in the range -128 ... 127 and cannot be used to access an array with 256 elements. Don't fix that but disable the buggy code. Signed-off-by: Stefan Weil <sw@weilnetz.de>
1 parent 997c4a6 commit 70fd7cd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ccstruct/mod128.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ DIR128::DIR128( //from fcoord
9494
* Convert a direction to a vector.
9595
**********************************************************************/
9696

97+
#if 0 // code is buggy for negative dir and unused
9798
ICOORD DIR128::vector() const { //convert to vector
9899
return dirtab[dir]; //easy really
99100
}
101+
#endif

0 commit comments

Comments
 (0)