Record Detail

Compile Error

/in/rational.c: In function 'reduce':
/in/rational.c:14:26: error: unused parameter 'a' [-Werror=unused-parameter]
 void reduce(RationalInt *a)
                          ^
/in/rational.c: In function 'set':
/in/rational.c:19:23: error: unused parameter 'a' [-Werror=unused-parameter]
 void set(RationalInt *a, int num, int den)
                       ^
/in/rational.c:19:30: error: unused parameter 'num' [-Werror=unused-parameter]
 void set(RationalInt *a, int num, int den)
                              ^~~
/in/rational.c:19:39: error: unused parameter 'den' [-Werror=unused-parameter]
 void set(RationalInt *a, int num, int den)
                                       ^~~
/in/rational.c: In function 'add':
/in/rational.c:26:10: error: invalid operands to binary + (have 'RationalInt {aka struct rational_t}' and 'RationalInt {aka const struct rational_t}')
     *a=*a+b;
        ~~^
/in/rational.c:27:12: error: 'return' with a value, in function returning void [-Werror]
     return *a;
            ^~
/in/rational.c:23:6: note: declared here
 void add(RationalInt *a, const RationalInt b)
      ^~~
/in/rational.c: In function 'subtract':
/in/rational.c:32:10: error: invalid operands to binary - (have 'RationalInt {aka struct rational_t}' and 'RationalInt {aka const struct rational_t}')
     *a=*a-b;
        ~~^
/in/rational.c:33:12: error: 'return' with a value, in function returning void [-Werror]
     return *a;
            ^~
/in/rational.c:29:6: note: declared here
 void subtract(RationalInt *a, const RationalInt b)
      ^~~~~~~~
/in/rational.c: In function 'multiply':
/in/rational.c:38:10: error: invalid operands to binary * (have 'RationalInt {aka struct rational_t}' and 'RationalInt {aka const struct rational_t}')
     *a=*a*b;
        ~~^
/in/rational.c:39:12: error: 'return' with a value, in function returning void [-Werror]
     return *a;
            ^~
/in/rational.c:35:6: note: declared here
 void multiply(RationalInt *a, const RationalInt b)
      ^~~~~~~~
/in/rational.c: In function 'divide':
/in/rational.c:44:10: error: invalid operands to binary / (have 'RationalInt {aka struct rational_t}' and 'RationalInt {aka const struct rational_t}')
     *a=*a/b;
        ~~^
/in/rational.c:45:12: error: 'return' with a value, in function returning void [-Werror]
     return *a;
            ^~
/in/rational.c:41:6: note: declared here
 void divide(RationalInt *a, const RationalInt b)
      ^~~~~~
cc1: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Lab 10
Language
C
Submit At
2020-07-21 22:59:29
Judged At
2020-07-21 22:59:29
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes