[Gimp-developer] Compilation error with GIMP git version

Dear developers,

I am getting the following compilation error with the current git version of GIMP, using gcc 4.8.5:

gcc -DHAVE_CONFIG_H -I. -I../..  -I../.. -pthread -I/zzz/include/gtk-2.0 -I/zzz/lib/gtk-2.0/include 
-I/zzz/include/atk-1.0 -I/zzz/include/cairo -I/zzz/include/gdk-pixbuf-2.0 -I/zzz/include/pango-1.0 
-I/zzz/include/glib-2.0 -I/zzz/lib/glib-2.0/include -I/zzz/include/pixman-1 -I/zzz/include/freetype2 
-I/zzz/include/libpng16 -I/zzz/include/harfbuzz   -pthread -I/zzz/include/gegl-0.3 
-I/zzz/include/json-glib-1.0 -I/zzz/include/gio-unix-2.0/ -I/zzz/include/babl-0.1 -I/zzz/include/glib-2.0 
-I/zzz/lib/glib-2.0/include   -I/zzz/include -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED 
-g -O2 -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Werror=missing-prototypes  
-Wmissing-declarations -Winit-self -Wpointer-arith  -Wmissing-format-attribute -Wformat-security -Wlogical-op 
-Wtype-limits -fno-common -fdiagnostics-show-option -Wreturn-type   -MT file-pcx.o -MD -MP -MF 
.deps/file-pcx.Tpo -c -o file-pcx.o file-pcx.c
file-pcx.c: In function ‘save_less_than_8’:
file-pcx.c:943:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
   for (gint x = 0; x < buf_size; x++)
file-pcx.c:943:3: note: use option -std=c99 or -std=gnu99 to compile your code
make[3]: *** [file-pcx.o] Error 1

The solution is simple, and consists of moving the declaration of

    gint x

in file-pcx.c outside of the for loop, for example immediately after 

    guchar  *line;

Hope this helps!

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]