Fivetonsofflax / opentyrian

Automatically exported from code.google.com/p/opentyrian
GNU General Public License v2.0
0 stars 0 forks source link

"uninitialized" variables in game_menu.c:JE_drawShipSpecs() #109

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Do a "make release"

What is the expected output? What do you see instead?
I see this:
[...]
cc -c -o obj/game_menu.o -std=c99 -I./src -DTARGET_UNIX -g0 -O2 -DNDEBUG -MMD 
-pedantic -Wall -Wextra -Wno-missing-field-initializers '-DHG_REV="e4af20342fbe 
default"' -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  src/game_menu.c
src/game_menu.c: In function ‘JE_drawShipSpecs’:
src/game_menu.c:2965: warning: ‘temp_x’ may be used uninitialized in this 
function
src/game_menu.c:2965: warning: ‘temp_y’ may be used uninitialized in this 
function

Since the code contains a comment indicating that this warning shouldn't occur 
("//This doubles as a 'shut up compiler' for whining about uninitted temp_x and 
y"), I'd expect this warning to not occur.

Please provide any additional information below.
This happens only with a "make release", not with a normal "make". This is 
because with "make release" NDEBUG is defined, causing the assert(0) (which is 
supposed to silence this warning) to do nothing at all.

Original issue reported on code.google.com by a.h.vand...@gmail.com on 20 Jul 2010 at 5:12

GoogleCodeExporter commented 9 years ago
fixed as of r61d49d9380

Original comment by mindless...@gmail.com on 24 Jul 2010 at 3:52