Like Tree1Likes
  • 1 Post By Salem

Silly-sounding compilor error

This is a discussion on Silly-sounding compilor error within the C Programming forums, part of the General Programming Boards category; linked_list.c:113:6: note: expected ‘struct LinkedListNode *’ but argument is of type ‘struct LinkedListNode *’ ?????? That makes no sense! lol! ...

  1. #1
    Time-Lord Victorious! The Doctor's Avatar
    Join Date
    Aug 2012
    Location
    Perth, Western Australia
    Posts
    50

    Silly-sounding compilor error

    linked_list.c:113:6: note: expected ‘struct LinkedListNode *’ but argument is of type ‘struct LinkedListNode *’
    ?????? That makes no sense! lol!

    Does anyone have any idea what I may have done wrong? I'm only just learning about structs, so I might not have that down pat.

    Here's my definition of the appropriate structs, that I have put into a .h file

    Code:
    typedef struct LinkedistNode
    {
            Entry* data; /*Entry is another struct type */
            struct LinkedListNode* next;
    } LinkedListNode;
    
    typedef struct
    {
            LinkedListNode* head;
    } LinkedList;
    (Yes, I am making a linked list)

    Something that might be relevant... Here's the function that it's having trouble with:
    Code:
    void freeNode( LinkedListNode* node) /*This is line 113 */
    {
    /*Relevant code here */
    }
    And here's the line that calls freeNode():

    Code:
         
       freeNode( (*list).head);
    I'm comipiling with gcc (on Ubuntu) with the -Wall -ansi -pedantic flags attached... (My teacher told me to, as we need to be using C89)

    Thanks for your help!
    Last edited by The Doctor; 09-13-2012 at 11:45 PM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,338
    Code:
    typedef struct LinkedistNode
    {
            Entry* data; /*Entry is another struct type */
            struct LinkedListNode* next;
    } LinkedListNode;
    Check your spelling.
    Adak likes this.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Time-Lord Victorious! The Doctor's Avatar
    Join Date
    Aug 2012
    Location
    Perth, Western Australia
    Posts
    50
    *FACEPALM*

    Doh! That fixed my other errors too! Thanks mate!
    Last edited by The Doctor; 09-14-2012 at 12:07 AM.
    Code:
    if (codeWorks( code) && !youCanDoSomethingBetter( code) )
    {
         beHappy();
    } else
    {
         fixCode( code);
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 19
    Last Post: 06-21-2007, 11:45 AM
  2. silly C querry
    By vinee in forum C Programming
    Replies: 3
    Last Post: 08-31-2006, 05:31 AM
  3. silly little error
    By meatcow in forum C++ Programming
    Replies: 4
    Last Post: 01-23-2006, 10:47 PM
  4. Silly error
    By kzar in forum C Programming
    Replies: 7
    Last Post: 10-17-2004, 04:07 AM
  5. Borland C++ 5.5 compilor help...req..
    By jawwadalam in forum C Programming
    Replies: 6
    Last Post: 05-19-2002, 04:46 AM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21