Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:13:88: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    return x >= 0 && x < (int)grid.size() && y >= 0 && y < (int)grid[0].size() && grid[x][y] != '#';
                                                                                  ~~~~ ^
/in/sokoban.hpp:13:91: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    return x >= 0 && x < (int)grid.size() && y >= 0 && y < (int)grid[0].size() && grid[x][y] != '#';
                                                                                  ~~~~    ^
/in/sokoban.hpp:27:17: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
    grid.resize(rows);
         ~~~~~~ ^~~~
/in/sokoban.hpp:30:27: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        getline(cin, grid[i]);
                     ~~~~ ^
/in/sokoban.hpp:43:22: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'S')
                ~~~~ ^
/in/sokoban.hpp:43:25: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'S')
                ~~~~    ^
/in/sokoban.hpp:47:27: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            else if (grid[i][j] == 'B')
                     ~~~~ ^
/in/sokoban.hpp:47:30: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            else if (grid[i][j] == 'B')
                     ~~~~    ^
/in/sokoban.hpp:72:27: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            else if (grid[i][j] == 'T')
                     ~~~~ ^
/in/sokoban.hpp:72:30: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            else if (grid[i][j] == 'T')
                     ~~~~    ^
/in/sokoban.hpp:39:23: error: comparison of integers of different signs: 'int' and 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
    for (int i = 0; i < grid.size(); ++i)
                    ~ ^ ~~~~~~~~~~~
/in/sokoban.hpp:41:27: error: comparison of integers of different signs: 'int' and 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-compare]
        for (int j = 0; j < grid[0].size(); ++j)
                        ~ ^ ~~~~~~~~~~~~~~
/in/sokoban.hpp:183:24: error: use of undeclared identifier 'INT_MAX'
        int min_dist = INT_MAX;
                       ^
/in/sokoban.hpp:200:39: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
        for (int j = 0; j < (int)grid[i].size(); ++j)
                                 ~~~~ ^
/in/sokoban.hpp:202:22: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'S')
                ~~~~ ^
/in/sokoban.hpp:202:25: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if (grid[i][j] == 'S')
                ~~~~    ^
/in/sokoban.hpp:207:27: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            else if (grid[i][j] == 'B')
                     ~~~~ ^
/in/sokoban.hpp:207:30: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            else if (grid[i][j] == 'B')
                     ~~~~    ^
/in/sokoban.hpp:211:27: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            else if (grid[i][j] == 'T')
                     ~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 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-25 01:37:09
Judged At
2024-11-25 01:37:09
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes