Package: freeglut
Version: 2.4.0-8
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd
Hi,
freeglut does not compile on GNU/Hurd with the following error log (wrapped
in multiple lines for readability):
> i486-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -Wall -g -O2 -g \
> -Wall -pedantic -Werror -MT libglut_la-freeglut_joystick.lo -MD -MP -MF \
> .deps/libglut_la-freeglut_joystick.Tpo -c freeglut_joystick.c -fPIC -DPIC \
> -o .libs/libglut_la-freeglut_joystick.o
> cc1: warnings being treated as errors
> freeglut_joystick.c: In function 'fghJoystickOpen':
> freeglut_joystick.c:1040: warning: unused variable 'i'
> make[3]: *** [libglut_la-freeglut_joystick.lo] Error 1
This is because there is the 'int i' declaration at the top of the function,
used for any OS, but there is no Hurd-specific block which uses it;
the proposed patch just initializes 'i', so it is considered used for every OS.
Hopefully should not harm every other OS.
Thanks,
--
Pino
--- freeglut-2.4.0.orig/src/freeglut_joystick.c
+++ freeglut-2.4.0/src/freeglut_joystick.c
@@ -1070,6 +1070,8 @@
joy->num_axes = joy->num_buttons = 0;
joy->name[ 0 ] = '\0';
+ i = 0;
+
#if TARGET_HOST_MACINTOSH
/* XXX FIXME: get joystick name in Mac */