eduard-permyakov / permafrost-engine

An OpenGL RTS game engine written in C
GNU General Public License v3.0
2.65k stars 114 forks source link

Uninitialized variables treated as error #19

Closed tujh-rf closed 4 years ago

tujh-rf commented 4 years ago
[CC]     obj/game/fog_of_war.o
[CC]     obj/game/clearpath.o
src/game/clearpath.c: In function ‘G_ClearPath_NewVelocity’:
src/game/clearpath.c:618:29: error: ‘ret.raw[1]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  618 |         s_debug_saved.v_new = ret;
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~
src/game/clearpath.c:343:12: note: ‘ret.raw[1]’ was declared here
  343 |     vec2_t ret;
      |            ^~~
src/game/clearpath.c:618:29: error: ‘ret.raw[0]’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  618 |         s_debug_saved.v_new = ret;
      |         ~~~~~~~~~~~~~~~~~~~~^~~~~
src/game/clearpath.c:343:12: note: ‘ret.raw[0]’ was declared here
  343 |     vec2_t ret;
      |            ^~~
cc1: all warnings being treated as errors
make: *** [Makefile:163: obj/game/clearpath.o] Error 1

Fedora, GCC 10.2.1