[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> As I was there, I've also included a report of the compiler warning I have
> (using gcc 3.1 shipped with latest Apple developer tools)
gcc -DALLEGRO_SRC -Wall -Wno-unused -O2 -funroll-loops -ffast-math
-fomit-frame-pointer -pipe -DALLEGRO_USE_C -I. -I./include -o
obj/macosx/alleg/gfx.o -c src/gfx.c
src/gfx.c:637: undefined type, found `y'
src/gfx.c:637: syntax error, missing `;' after `+='
src/gfx.c:637: undefined type, found `x'
src/gfx.c:637: syntax error, missing `;' after `+='
[...]
cpp-precomp: warning: errors during smart preprocessing, retrying in basic
mode
Ah! yes, the famous PFE (Persistent Front-End) implementation that Apple
devised for Jaguar and advertised as giving a 6x speed increase for their
typical huge header files... a big evil hack. They hired some time ago the
Red Hat employee that was developing PCH support for GCC, hopefully they
will quickly forget PFE.
Now on the syntax errors: they appears in
if (dd sec_cond 0) { \
sec_c sec_sign##= 1; \
dd += i2; \
} \
else \
dd += i1; \
\
pri_c pri_sign##= 1; \
The "smart" preprocessor interprets "sec_c" as a type specifier, although it
expands as the variable "y", because it is trying to compile the
preprocessor macro before expanding it. It is probably fooled because it
considers 'sec_sign' as a variable specifier, so it tries to apply the
type-specifier variable-specifier;
grammar rule. I'm inclined to think it's a compiler bug, but I'm not a
specialist of the C preprocessor.
We can try to work around it: does it work to write
if (dd sec_cond 0) { \
sec_c = sec_c sec_sign 1; \
dd += i2; \
} \
else \
dd += i1; \
\
pri_c = pri_c pri_sign 1; \
instead?
gcc -DALLEGRO_SRC -Wall -Wno-unused -O2 -funroll-loops -ffast-math
-fomit-frame-pointer -pipe -DALLEGRO_USE_C -I. -I./include -o
obj/macosx/alleg/lbm.o -c src/lbm.c
src/lbm.c:68: illegal cast, missing `)' after `id'
src/lbm.c:68: illegal expression, found `&&'
src/lbm.c:68: illegal cast, missing `)' after `id'
src/lbm.c:76: illegal external declaration, found `if'
src/lbm.c:76: illegal external declaration, missing `;' after `id'
[...]
cpp-precomp: warning: errors during smart preprocessing, retrying in basic
mode
Weird. Rename 'id' to something else.
cc -DALLEGRO_SRC -Wall -Wno-unused -O2 -funroll-loops -ffast-math
-fomit-frame-pointer -pipe -DALLEGRO_USE_C -I. -I./include -o
obj/macosx/alleg/unicode.o -c src/unicode.c
src/unicode.c: In function `decode_format_string':
src/unicode.c:2897: warning: use of `long double' type; its size may change
in a future release
src/unicode.c:2897: warning: (Long double usage is reported only once for
each file.
src/unicode.c:2897: warning: To disable this warning, use -Wno-long-double.)
You need to tweak the configure machinery to pass -Wno-long-double on Darwin
(see configure.in:577)
gcc -Wall -Wno-unused -O2 -funroll-loops -ffast-math -fomit-frame-pointer
-pipe -DALLEGRO_USE_C -I. -I./include -o obj/macosx/alleg/gfxinfo.o -c
tests/gfxinfo.c
tests/gfxinfo.c:29: illegal cast, missing `)' after `id'
tests/gfxinfo.c:30: illegal cast, missing `)' after `id'
tests/gfxinfo.c:31: illegal cast, missing `)' after `id'
cpp-precomp: warning: errors during smart preprocessing, retrying in basic
mode
Weird. Rename 'id' to something else.
gcc -Wall -Wno-unused -O2 -funroll-loops -ffast-math -fomit-frame-pointer
-pipe -DALLEGRO_USE_C -I. -I./include -o obj/macosx/alleg/play.o -c
tests/play.c
tests/play.c:34: illegal cast, missing `)' after `id'
tests/play.c:35: illegal cast, missing `)' after `id'
tests/play.c:36: illegal cast, missing `)' after `id'
cpp-precomp: warning: errors during smart preprocessing, retrying in basic
mode
Weird. Rename 'id' to something else.
gcc -Wall -Wno-unused -O2 -funroll-loops -ffast-math -fomit-frame-pointer
-pipe -DALLEGRO_USE_C -I. -I./include -o obj/macosx/alleg/dat2c.o -c
tools/dat2c.c
tools/dat2c.c:690: illegal cast, missing `)' after `id'
tools/dat2c.c:691: illegal cast, missing `)' after `id'
tools/dat2c.c:692: illegal cast, missing `)' after `id'
cpp-precomp: warning: errors during smart preprocessing, retrying in basic
mode
Weird. Rename 'id' to something else.
gcc -o tools/dat2c obj/macosx/alleg/dat2c.o lib/macosx/liballeg.a -lpthread
-framework Cocoa -framework Carbon
gcc -Wall -Wno-unused -O2 -funroll-loops -ffast-math -fomit-frame-pointer
-pipe -DALLEGRO_USE_C -I. -I./include -o obj/macosx/alleg/exedat.o -c
tools/exedat.c
gcc -o tools/exedat obj/macosx/alleg/exedat.o lib/macosx/liballeg.a
-lpthread -framework Cocoa -framework Carbon
ld: warning multiple definitions of symbol _err
obj/macosx/alleg/exedat.o definition of _err in section (__DATA,__data)
/usr/lib/libpthread.dylib(err.So) definition of _err
Static-ify err.
gcc -Wall -Wno-unused -O2 -funroll-loops -ffast-math -fomit-frame-pointer
-pipe -DALLEGRO_USE_C -I. -I./include -o obj/macosx/alleg/pack.o -c
tools/pack.c
gcc -o tools/pack obj/macosx/alleg/pack.o lib/macosx/liballeg.a -lpthread
-framework Cocoa -framework Carbon
ld: warning multiple definitions of symbol _err
obj/macosx/alleg/pack.o definition of _err in section (__TEXT,__text)
/usr/lib/libpthread.dylib(err.So) definition of _err
Likewise.
You could try to silent the warnings and re-diff if you succeed.
--
Eric Botcazou