Re: Wierd compiler error

From: Jason Wilkins (fenix@IO.COM)
Date: 10/04/98


Ronny Iversen wrote:

> This little code gives some wierd error messages, can anybody help
> me(gcc report at the end :))
>
> > int main(void) {
> > #define NUM_OBJ_SENTINELS (2)
>

The NUM_OBJ_SENTINELS is 2

> >   struct obj_sentinel_recog osn_list[(NUM_OBJ_SENTINELS-1)] = {

2 - 1 is 1

> >     { 10, 3005, 1, "You may pass.", "Give me a Black Lotus first and
> > you may pass."},
> >     { 11, 3006, 2, "You may pass.", "Give me a Scepter first and you
> > may pass."},
> >     { 11, 3006, 4, "You may pass.", "Give me a Crown of the Ages first
> > and you may pass."}
> >   };

There are 3 elements defined for the array.


> > temp.c: In function `main':
> > temp.c:16: warning: excess elements in array initializer after
> > `osn_list'
> > temp.c:17: warning: excess elements in array initializer after
> > `osn_list'
>

Therefore for you get this error

> Once againI bug this list with silly questions

Too easy, you got something difficult? ^_^

--
           Phoenix -- President of The Artistic Intuition Company
       Caelius * Mirror Reflex * Runica * X-Domain * Infinite Realms
                          http://www.io.com/~fenix


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



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