Record Detail

Compile Error

/in/double_list.c: In function 'push':
/in/double_list.c:13:58: error: invalid application of 'sizeof' to incomplete type 'struct node_t'
     struct Node* new_node = (struct node_t)malloc(sizeof(struct node_t));
                                                          ^~~~~~
/in/double_list.c:15:14: error: dereferencing pointer to incomplete type 'struct Node'
     new_node -> data = num;
              ^~
/in/double_list.c:20:27: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
         (*head_ref)->prev = new_node;
                           ^
/in/double_list.c:22:17: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     (*head_ref) = new_node;
                 ^
/in/double_list.c: In function 'insertAfter':
/in/double_list.c:47:59: error: invalid application of 'sizeof' to incomplete type 'struct node_t'
     struct Node* new_node = (struct node_t*)malloc(sizeof(struct node_t));
                                                           ^~~~~~
/in/double_list.c:49:14: error: dereferencing pointer to incomplete type 'struct Node'
     new_node -> data = num;
              ^~
/in/double_list.c:53:21: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
     prev_node->next = new_node;
                     ^
/in/double_list.c: In function 'append':
/in/double_list.c:65:59: error: invalid application of 'sizeof' to incomplete type 'struct node_t'
     struct Node* new_node = (struct node_t*)malloc(sizeof(struct node_t));
                                                           ^~~~~~
/in/double_list.c:66:25: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     struct Node* last = *head_ref; /* used in step 5*/
                         ^
/in/double_list.c:68:13: error: dereferencing pointer to incomplete type 'struct Node'
     new_node->data = new_data;
             ^~
/in/double_list.c:74:19: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
         *head_ref = new_node;
                   ^
/in/double_list.c: In function 'freeList':
/in/double_list.c:102:28: error: '*head_ref' is a pointer; did you mean to use '->'?
         head_ref = head_ref->next;
                            ^~
                            ->
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab 8
Language
C
Submit At
2020-07-03 23:52:49
Judged At
2020-07-03 23:52:49
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes