Record Detail

Compile Error

/in/simulation.cpp: In function 'void simulateCreature(creature_t&, grid_t&, bool, int)':
/in/simulation.cpp:256:13: error: variable 'cur_location' set but not used [-Werror=unused-but-set-variable]
     point_t cur_location = creature.location;
             ^~~~~~~~~~~~
/in/simulation.cpp:261:17: error: unused variable 'cur_direction' [-Werror=unused-variable]
     direction_t cur_direction = creature.direction;
                 ^~~~~~~~~~~~~
/in/simulation.cpp:262:16: error: unused variable 'cur_species' [-Werror=unused-variable]
     species_t* cur_species = creature.species;
                ^~~~~~~~~~~
/in/simulation.cpp:263:18: error: unused variable 'ID' [-Werror=unused-variable]
     unsigned int ID = creature.programID;
                  ^~
/in/simulation.cpp: In function 'bool canInfect(const creature_t&, const grid_t&)':
/in/simulation.cpp:509:13: error: variable 'next' set but not used [-Werror=unused-but-set-variable]
     point_t next = adjacentPoint(creature.location, creature.direction);
             ^~~~
/in/simulation.cpp: In function 'point_t adjacentPoint(point_t, direction_t)':
/in/simulation.cpp:396:12: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return res;
            ^~~
/in/simulation.cpp:396:12: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
/in/simulation.cpp: In function 'bool isEmptyAhead(const creature_t&, const grid_t&)':
/in/simulation.cpp:471:71: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     point_t next = adjacentPoint(creature.location, creature.direction);
                                                                       ^
/in/simulation.cpp:371:9: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int next_r, next_c;
         ^~~~~~
/in/simulation.cpp: In function 'bool isWallAhead(const creature_t&, const grid_t&)':
/in/simulation.cpp:461:87: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return pt.r >= 0 && static_cast<unsigned int>(pt.r) < grid.height && pt.c >= 0 && static_cast<unsigned int>(pt.c) < grid.width;
                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:371:17: note: 'next_c' was declared here
     int next_r, next_c;
                 ^~~~~~
/in/simulation.cpp:371:9: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int next_r, next_c;
         ^~~~~~
/in/simulation.cpp: In function 'bool canHop(const creature_t&, const grid_t&)':
/in/simulation.cpp:461:87: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return pt.r >= 0 && static_cast<unsigned int>(pt.r) < grid.height && pt.c >= 0 && static_cast<unsigned int>(pt.c) < grid.width;
                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:371:17: note: 'next_c' was declared here
     int next_r, next_c;
                 ^~~~~~
/in/simulation.cpp:461:25: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return pt.r >= 0 && static_cast<unsigned int>(pt.r) < grid.height && pt.c >= 0 && static_cast<unsigned int>(pt.c) < grid.width;
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:371:9: note: 'next_r' was declared here
     int next_r, next_c;
         ^~~~~~
/in/simulation.cpp: In function 'void hopCreature(creature_t&, grid_t&)':
/in/simulation.cpp:494:71: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     point_t next = adjacentPoint(creature.location, creature.direction); // Get the point to hop to
                                                                       ^
/in/simulation.cpp:371:9: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int next_r, next_c;
         ^~~~~~
/in/simulation.cpp: In function 'bool isFacingSame(const creature_t&, const grid_t&)':
/in/simulation.cpp:461:87: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return pt.r >= 0 && static_cast<unsigned int>(pt.r) < grid.height && pt.c >= 0 && static_cast<unsigned int>(pt.c) < grid.width;
                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:371:17: note: 'next_c' was declared here
     int next_r, next_c;
                 ^~~~~~
/in/simulation.cpp:420:29: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return grid.squares[r][c];
                             ^
/in/simulation.cpp:371:9: note: 'next_r' was declared here
     int next_r, next_c;
         ^~~~~~
/in/simulation.cpp: In function 'bool isFacingEnemy(const creature_t&, const grid_t&)':
/in/simulation.cpp:461:87: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return pt.r >= 0 && static_cast<unsigned int>(pt.r) < grid.height && pt.c >= 0 && static_cast<unsigned int>(pt.c) < grid.width;
                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/in/simulation.cpp:371:17: note: 'next_c' was declared here
     int next_r, next_c;
                 ^~~~~~
/in/simulation.cpp:420:29: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     return grid.squares[r][c];
                             ^
/in/simulation.cpp:371:9: note: 'next_r' was declared here
     int next_r, next_c;
         ^~~~~~
/in/simulation.cpp: In function 'void infectCreature(creature_t&, grid_t&)':
/in/simulation.cpp:519:71: error: 'next_c' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     point_t next = adjacentPoint(creature.location, creature.direction);
                                                                       ^
/in/simulation.cpp:371:9: error: 'next_r' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     int next_r, next_c;
         ^~~~~~
cc1plus: all warnings being treated as errors

Information

Submit By
Type
Submission
Homework
Project 3
Language
C++
Submit At
2024-11-14 14:34:47
Judged At
2024-11-14 14:34:47
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes