Re: [CODE] Warning: array subscript has type 'char'

From: Xual (xual@danathara.dhs.org)
Date: 12/26/99


On Sun, 26 Dec 1999, Robert Moon wrote:

> I am receving an error message that I don't understand why.  The message is
> "warning: array subscript has type 'char'" for the line:
>
>   if (start_emp[i][GET_RACE(d->character)]) {

<snip>

> If anyone can tell my I'm getting this error "warning: array subscript has
> type 'char'", I'd be most appreciative.  Thanks.

The GET_RACE() macro returns a char (you added char race to the player_data
struct when you added races) and you are using that char as a subscript in
an array of integers.  To make it go away, just cast it as an int:

if (start_emp[i][(int)GET_RACE(d->character)]) {


--

"Two roads diverged in a wood, and I - I took the one less traveled
 by, and that has made all the difference. "
        -= Robert Frost =-


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST