Record Detail

Compile Error

/in/ex5.c:9:16: error: redefinition of 'universalSet'
typedef struct universalSet { 
               ^
/in/src/universal_set.h:13:16: note: previous definition is here
typedef struct universalSet {
               ^
/in/ex5.c:13:3: error: typedef redefinition with different types ('struct (anonymous struct at /in/ex5.c:9:16)' vs 'struct universalSet')
} uset;
  ^
/in/src/universal_set.h:17:3: note: previous definition is here
} uset;
  ^
/in/ex5.c:16:52: error: implicit conversion changes signedness: 'int' to 'unsigned long' [-Werror,-Wsign-conversion]
    (*set)->elem=malloc((unsigned long)INITSETSIZE*type);
                                                  ~^~~~
/in/ex5.c:27:26: error: invalid operands to binary expression ('int' and 'void')
    if((*set).elem==NULL || *elem=NULL) return;
       ~~~~~~~~~~~~~~~~~ ^  ~~~~~
/in/ex5.c:29:32: error: arithmetic on a pointer to void is a GNU extension [-Werror,-Wpointer-arith]
        if(*(char*)((*set).elem+i)==*(char*)elem) return;
                    ~~~~~~~~~~~^
/in/ex5.c:30:6: error: expected '}'
    }
     ^
/in/ex5.c:25:36: note: to match this '{'
void addElem(void *elem, uset *set){
                                   ^
6 errors generated.

Information

Submit By
Type
Submission
Homework
Homework 6
Language
C (Clang, with memory check)
Submit At
2022-11-13 10:22:30
Judged At
2022-11-13 10:22:30
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes