Record Detail

Compile Error

prepare (1/3): 
finished

make (2/3): 
clang -std=gnu11 -O2 -Wall -Wextra -Werror -pedantic -Wno-unused-result -Wconversion -Wvla -o l5 *.c
clang -std=gnu11 -O2 -Wall -Wextra -Werror -pedantic -Wno-unused-result -Wconversion -Wvla -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined -fsanitize=integer -o l5_memory_check *.c
lab5_dlist.c:42lab5_dlist.c:42:38: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        while(tmp->next != NULL) tmp = tmp->next;
                                     ^ ~~~~~~~~~
lab5_dlist.c:43:19: error: incompatible pointer types assigning to 'struct node *' from 'node *' (aka 'struct node_t *') [-Werror,-Wincompatible-pointer-types]
        tmp->next = n;        
                  ^ ~
:38lab5_dlist.c:49:5: error: implicit declaration of function 'assert' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    assert(x != NULL);
    ^
: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        while(tmp->next != NULL) tmp = tmp->next;
                                     ^ ~~~~~~~~~
lab5_dlist.c:43:19: error: incompatible pointer types assigning to 'struct node *' from 'node *' (aka 'struct node_t *') [-Werror,-Wincompatible-pointer-types]lab5_dlist.c:70:13: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        tmp = tmp->next;
            ^ ~~~~~~~~~

        tmp->next = n;        
                  ^ ~
lab5_dlist.c:86:70: error: incompatible pointer types assigning to 'struct node *' from 'node *' (aka 'struct node_t *') [-Werror,-Wincompatible-pointer-types]
    for(int i = 0; i < ((list *)this)->size - 1; i++) nodes[i]->next = nodes[i+1];
                                                                     ^ ~~~~~~~~~~
lab5_dlist.c:60:40: error: unused parameter 'listDst' [-Werror,-Wunused-parameter]
void dlistSort(dlist_const this, dlist listDst, dlistSortMethod method){
                                       ^
lab5_dlist.c:60:65: error: unused parameter 'method' [-Werror,-Wunused-parameter]
void dlistSort(dlist_const this, dlist listDst, dlistSortMethod method){
                                                                ^
lab5_dlist.c:49:5: errorlab5_dlist.c:95:73: error: format specifies type 'int' but the argument has type 'dlistValue' (aka 'union dlistValue_t') [-Werror,-Wformat]
        if(((list *)this)->type == DLIST_INT) printf("%s=%d\n", tmp->k, tmp->v);
                                                         ~~             ^~~~~~
: implicit declaration of function 'assert' is invalid in C99 [-Werror,-Wimplicit-function-declaration]lab5_dlist.c:96:78: error: format specifies type 'char *' but the argument has type 'dlistValue' (aka 'union dlistValue_t') [-Werror,-Wformat]
        else if(((list *)this)->type == DLIST_STR) printf("%s=%s\n", tmp->k, tmp->v);

                                                              ~~             ^~~~~~
    assert(x != NULL);lab5_dlist.c:97:41: error: format specifies type 'double' but the argument has type 'dlistValue' (aka 'union dlistValue_t') [-Werror,-Wformat]
        else printf("%s=%lf\n", tmp->k, tmp->v);
                        ~~~             ^~~~~~
lab5_dlist.c:98:13: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        tmp = tmp->next;
            ^ ~~~~~~~~~

    ^
lab5_dlist.c:91:8: error: variable 'tmp' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    if(((list *)this)->size == 0) return;
       ^~~~~~~~~~~~~~~~~~~~~~~~~
lab5_dlist.c:94:11: note: uninitialized use occurs here
    while(tmp->next != NULL){
          ^~~
lab5_dlist.c:91:5: note: remove the 'if' if its condition is always true
    if(((list *)this)->size == 0) return;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lab5_dlist.c:93:14: note: initialize the variable 'tmp' to silence this warning
    node *tmp;
             ^
              = NULL
lab5_dlist.c:108:13: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        tmp = tmp->next;
            ^ ~~~~~~~~~
lab5_dlist.c:13 errors generated.
70:13: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        tmp = tmp->next;
            ^ ~~~~~~~~~
lab5_dlist.c:86:70: error: incompatible pointer types assigning to 'struct node *' from 'node *' (aka 'struct node_t *') [-Werror,-Wincompatible-pointer-types]
    for(int i = 0; i < ((list *)this)->size - 1; i++) nodes[i]->next = nodes[i+1];
                                                                     ^ ~~~~~~~~~~
lab5_dlist.c:60:40: error: unused parameter 'listDst' [-Werror,-Wunused-parameter]
void dlistSort(dlist_const this, dlist listDst, dlistSortMethod method){
                                       ^
lab5_dlist.c:60:65: error: unused parameter 'method' [-Werror,-Wunused-parameter]
void dlistSort(dlist_const this, dlist listDst, dlistSortMethod method){
                                                                ^
lab5_dlist.c:95:73: error: format specifies type 'int' but the argument has type 'dlistValue' (aka 'union dlistValue_t') [-Werror,-Wformat]
        if(((list *)this)->type == DLIST_INT) printf("%s=%d\n", tmp->k, tmp->v);
                                                         ~~             ^~~~~~
lab5_dlist.c:96:78: error: format specifies type 'char *' but the argument has type 'dlistValue' (aka 'union dlistValue_t') [-Werror,-Wformat]
        else if(((list *)this)->type == DLIST_STR) printf("%s=%s\n", tmp->k, tmp->v);
                                                              ~~             ^~~~~~
lab5_dlist.c:97:41: error: format specifies type 'double' but the argument has type 'dlistValue' (aka 'union dlistValue_t') [-Werror,-Wformat]
        else printf("%s=%lf\n", tmp->k, tmp->v);
                        ~~~             ^~~~~~
lab5_dlist.c:98:13: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        tmp = tmp->next;
            ^ ~~~~~~~~~
lab5_dlist.c:91:8: error: variable 'tmp' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
    if(((list *)this)->size == 0) return;
       ^~~~~~~~~~~~~~~~~~~~~~~~~
lab5_dlist.c:94:11: note: uninitialized use occurs here
    while(tmp->next != NULL){
          ^~~
lab5_dlist.c:91:5: note: remove the 'if' if its condition is always true
    if(((list *)this)->size == 0) return;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lab5_dlist.c:93:14: note: initialize the variable 'tmp' to silence this warning
    node *tmp;
             ^
              = NULL
lab5_dlist.c:108:13: error: incompatible pointer types assigning to 'node *' (aka 'struct node_t *') from 'struct node *' [-Werror,-Wincompatible-pointer-types]
        tmp = tmp->next;
            ^ ~~~~~~~~~
13 errors generated.
Makefile:13: recipe for target 'l5' failed
make: *** [l5] Error 1
make: *** Waiting for unfinished jobs....
Makefile:16: recipe for target 'l5_memory_check' failed
make: *** [l5_memory_check] Error 1

build failed

Information

Submit By
Type
Submission
Homework
DList Series 1
Language
GNU Make
Submit At
2021-10-27 20:50:38
Judged At
2021-10-27 20:50:38
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes