09 Aug, 2013, Atolmasoff wrote in the 1st comment:
Votes: 0
comm.c:1775:13: warning: array subscript has type char [-Wchar-subscripts]


There a package I can install, or something I can do with my ROM Mud to make these go away? I know of a method, but it takes line by line editing. It's a new Cygwin error since the last time I used it, was curious if anyone knew a quick way to clean it up?
09 Aug, 2013, quixadhal wrote in the 2nd comment:
Votes: 0
The correct solution is to not use character variables to index an array, which is why the newer version of the gcc compiler is whining at you.
You can cheat by going through and typecasting all those places as (int).
You can also cheat by turning off the compiler warning (which the man page should tell you about).
09 Aug, 2013, Fizban wrote in the 3rd comment:
Votes: 0
Atolmasoff said:
I know of a method, but it takes line by line editing.


That'd be the right thing to do most likely. It's by no means a "Cygwin error". It's poor code which earlier versions of gcc ignored that newer, better, versions of gcc now catch.

The goal when coding should be to have clean code which doesn't generate warnings or errors, not to hackishly make warnings and errors go away while still having poor code just because you don't want to see them.
09 Aug, 2013, Atolmasoff wrote in the 4th comment:
Votes: 0
No no, you've mis-understood. I have no intention of Hiding these errors, but I've never seen them before and program more as a hobby. So I have every intention of making it work properly, just not sure exactly what I need to do for that to work.

I went through a SocketMUD code and fixed all the warningss there, but this one has Much, MUCH more warnings. So was more or less seeing if there was a 'quick' way to do it.

I'd like to fix it without 'cheating'. What would be the proper method?
09 Aug, 2013, Tyche wrote in the 5th comment:
Votes: 0
1 - Edit and fix the code line by line
2 - Turn off the warning message
3 - Install the gcc 3.x version of the compiler
09 Aug, 2013, quixadhal wrote in the 6th comment:
Votes: 0
Well, the "correct" way to fix it would require you find the thing that is being used as the index and change it to an appropriate type (integer). However, as it's pretty likely this is part of a structure that's used elsewhere (IE: player_data), that may entail many other changes, including changes to the data loading and saving routines. If your codebase uses binary format files anywhere, it would invalidate those older binary files unless you convert them to the new format.

MOST people choose cheat #1, since type-casting tells the compiler "Yes, I know it's not an integer, but trust me… it works fine."
09 Aug, 2013, Atolmasoff wrote in the 7th comment:
Votes: 0
Sounds good to me. I started typecasting them, just wanted to make sure. Thx much
Random Picks
0.0/7