On Mon, Jan 11, 2010 at 11:33 AM, Keith Whitwell <kei...@vmware.com> wrote: > On Mon, 2010-01-11 at 11:18 -0800, Luca Barbieri wrote: >> > gcc -c -I../../include -I../../src/mesa -I../../src/gallium/include >> > -I../../src/gallium/auxiliary -Wall -Wmissing-prototypes >> > -Wdeclaration-after-statement -Wpointer-arith -g -fPIC -D_POSIX_SOURCE >> > -D_POSIX_C_SOURCE=199309L -D_SVID_SOURCE -D_BSD_SOURCE -D_GNU_SOURCE >> > -DPTHREADS -DUSE_XSHM -DHAVE_POSIX_MEMALIGN -DDEBUG -DDEBUG_MATH >> > -I/usr/X11R6/include -std=c99 -ffast-math -fno-strict-aliasing -ansi >> > -pedantic state_tracker/st_cb_texture.c -o state_tracker/st_cb_texture.o >> > state_tracker/st_cb_texture.c: In function 'st_TexImage': >> > state_tracker/st_cb_texture.c:689: warning: initialization discards >> > qualifiers from pointer target type >> > state_tracker/st_cb_texture.c:690: error: 'for' loop initial declarations >> > are only allowed in C99 mode >> >> On my setup (./configure && make) Mesa is getting built in C99 mode, >> which compiles that code. >> The command line you quoted actually contains "-std=c99", but also >> contains "-ansi" later, which is causing the problem. >> >> It seems that the "linux-debug" target includes "-ansi" (thus >> disabling C99) but the default autoconf one doesn't, resulting in C99 >> mode!
Just for the background on where the autoconf CFLAGS defaults come from, I just copied them from configs/linux and they haven't really been changed since. This is also the reason for -ffast-math. I think that -std=c99 was copied over from configs/linux-dri, which has it's origins back in 2004. http://cgit.freedesktop.org/mesa/mesa/commit/?id=e61df587295e585a3643b523c499d6594962f76a -- Dan ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev