Record Detail

Compile Error

/in/simulation.cpp: In function 'bool initWorld(world_t&, const string&)':
/in/simulation.cpp:43:30: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (height < 1 || height >= MAXHEIGHT){
                       ~~~~~~~^~~~~~~~~~~~
/in/simulation.cpp:49:28: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (width < 1 || width >= MAXWIDTH){
                      ~~~~~~^~~~~~~~~~~
/in/simulation.cpp: In function 'bool findSpecies(world_t&, const string&, creature_t&)':
/in/simulation.cpp:89:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int i = 0; i < world.numSpecies; i++){
                     ~~^~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'creature_t extractCreature(std::__cxx11::string, world_t&, std::stringstream&)':
/in/simulation.cpp:117:24: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (row < 0 || row >= world.grid.height || col < 0 || col >= world.grid.width){
                    ~~~~^~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:117:63: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     if (row < 0 || row >= world.grid.height || col < 0 || col >= world.grid.width){
                                                           ~~~~^~~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'void simulateRound(world_t&, bool)':
/in/simulation.cpp:227:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int i = 0; i < world.numCreatures; i++){
                     ~~^~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp: In function 'bool insideGrid(point_t, grid_t&)':
/in/simulation.cpp:367:30: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     return pt.r >= 0 && pt.r < grid.height && pt.c >= 0 && pt.c < grid.width;
                         ~~~~~^~~~~~~~~~~~~
/in/simulation.cpp:367:65: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     return pt.r >= 0 && pt.r < grid.height && pt.c >= 0 && pt.c < grid.width;
                                                            ~~~~~^~~~~~~~~~~~
/in/simulation.cpp: In function 'bool isExecuteInstruction(instruction_t&)':
/in/simulation.cpp:405:12: error: enumeration value 'IFEMPTY' not handled in switch [-Werror=switch]
     switch (instruction.op){
            ^
/in/simulation.cpp:405:12: error: enumeration value 'IFENEMY' not handled in switch [-Werror=switch]
/in/simulation.cpp:405:12: error: enumeration value 'IFSAME' not handled in switch [-Werror=switch]
/in/simulation.cpp:405:12: error: enumeration value 'IFWALL' not handled in switch [-Werror=switch]
/in/simulation.cpp:405:12: error: enumeration value 'GO' not handled in switch [-Werror=switch]
/in/simulation.cpp: In function 'void printGrid(const grid_t&)':
/in/simulation.cpp:419:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
     for (int i = 0; i < grid.height; i++) {
                     ~~^~~~~~~~~~~~~
/in/simulation.cpp:420:27: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
         for (int j = 0; j < grid.width; j++) {
                         ~~^~~~~~~~~~~~
/in/simulation.cpp: In function 'direction_t leftFrom(direction_t)':
/in/simulation.cpp:351:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
/in/simulation.cpp: In function 'direction_t rightFrom(direction_t)':
/in/simulation.cpp:364:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2024-11-13 22:03:10
Judged At
2024-11-13 22:03:10
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes