Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:165:49: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
            size_t dist_x = static_cast<size_t>(abs(box.first - goal.first));
                                                ^
/in/sokoban.hpp:165:49: note: remove the call to 'abs' since unsigned values cannot be negative
            size_t dist_x = static_cast<size_t>(abs(box.first - goal.first));
                                                ^~~
/in/sokoban.hpp:166:49: error: taking the absolute value of unsigned type 'unsigned long' has no effect [-Werror,-Wabsolute-value]
            size_t dist_y = static_cast<size_t>(abs(box.second - goal.second));
                                                ^
/in/sokoban.hpp:166:49: note: remove the call to 'abs' since unsigned values cannot be negative
            size_t dist_y = static_cast<size_t>(abs(box.second - goal.second));
                                                ^~~
/in/sokoban.hpp:165:63: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
            size_t dist_x = static_cast<size_t>(abs(box.first - goal.first));
                                                ~~~ ~~~~~~~~~~^~~~~~~~~~~~
/in/sokoban.hpp:166:64: error: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Werror,-Wshorten-64-to-32]
            size_t dist_y = static_cast<size_t>(abs(box.second - goal.second));
                                                ~~~ ~~~~~~~~~~~^~~~~~~~~~~~~
4 errors generated.
/in/Compile/Makefile:16: recipe for target 'main' failed
make: *** [main] Error 1

Information

Submit By
Type
Submission
Homework
Project3
Language
C++
Submit At
2024-11-27 14:30:49
Judged At
2024-11-27 14:30:49
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes