Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Look into how you're forward declaring MList in mlist.h. You use the syntax</p> <pre><code> typedef struct mlist MList; </code></pre> <p>This looks a little off to me. You're declaring a type of name MList. Note that with the above style of declaration, the compiler expects to see "struct mlist" or just the type name's MList when referring to this struct. (This <a href="https://stackoverflow.com/questions/1737710/c-structs-dont-define-types">question</a> may be helpful to you). However later on you definen a struct MList as follows:</p> <pre><code>struct MList{ int size; struct Mlist_head hashtable[HASHSIZE]; }; </code></pre> <p>Which makes the compiler expect afterwords to see things referred to with "struct MList". But in your fwd declaration, you just said that plain old "MList" without the struct is ok. The compiler may or may not be able to make sense of this confusion between the fwd declaration and your definition. Its made worse in that one is a tag name of the struct and the other is the struct's canonical name. This kind of thing makes my spidy sense tingle that something could be off and causing confusion between you and the compiler.</p> <p>I would just change how you forward declare to be consistent with how Mlist is used and see if that helps you. To do this change the above line to:</p> <pre><code> struct MList; </code></pre> <p>(then notice in mlist.h how you inconsistently use the struct keyword when referring to MList. Sometimes you do and sometimes you don't. this may also be causing problems w/ confusing your compiler. If you change to the above fwd declaration, use struct MList, not just MList)</p> <p>In other news, for:</p> <pre><code>mlist.c:63:37: warning: assignment from incompatible pointer type </code></pre> <p>You're assigning a MEntry to a MNode, which are of different types, so I would expect you to get the warning you're getting.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload