Re: [CODE] [NEWBIE] Redefinition of list_char_to_char2

From: Patrick Dughi (dughi@IMAXX.NET)
Date: 07/01/98


Chances are that you're using the function list_char_to_char2 before its
defined:

void code {
  list_char_to_char2();
}

void list_char_to_char2 {
/* your code */
}

        This is bad, and you'll have to prototype your functions before
you call them, else the compiler will make the assumption that your return
type on that function is 'int' (i believe, its been a while since I got
this error). Then, lateron, if you type it as returning void, its
considered a redefinition, and thats bad.

        Prototype up at the top, or in a header file.

                                                PjD

On Wed, 1 Jul 1998, John Woods wrote:

> I tried to compile this and it gave me the following error:
>
> act.informative.c(426) : error C2371: 'list_char_to_char2' : redefinition;
> different basic types
>
> So I looked it up in my help file, and it compared it to having
>
> void main(void) {
>   int i;
>   char i;
> }
>
> I couldn't see in my function where I'm doing that, or for that matter where
> in the entire FILE I have that function more than once, and I ran a
> search...it's the only time that function is in there. I tried changing
> variable names and types, but it didn't help. Anyone know why?
>
> void list_obj_to_char2(struct obj_data * list, struct char_data * ch, int
> mode,
>                            int show)
> {
>   struct obj_data *i;
>   bool found;
> ...
>
> Thanks,
> -Elrelet
>
> PS: I modified the function and renamed it with a 2...that's not a typo.
>
>
>      +------------------------------------------------------------+
>      | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>      | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>      +------------------------------------------------------------+
>


     +------------------------------------------------------------+
     | 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