On Tue, Aug 27, 2013 at 09:43:31AM +0200, Natanael Copa wrote: > Hi, > > git-1.8.4 fails to build with this error: > > cc -o config.o -c -MF ./.depend/config.o.d -MQ config.o -MMD -MP -Os > -fomit-frame-pointer -pipe -g -O2 -Wall -I. -DUSE_LIBPCRE -DNO_NSEC > -DNO_GETTEXT -DNO_ICONV -DHAVE_PATHS_H -DHAVE_DEV_TTY > -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRLCPY -DUSE_WILDMATCH -DNO_MKSTEMPS > -DSHELL_PATH='"/bin/sh"' -DETC_GITCONFIG='"/etc/gitconfig"' config.c > In file included from /usr/include/stdio.h:72:0, > from git-compat-util.h:99, > from cache.h:4, > from config.c:8: > config.c: In function 'get_next_char': > config.c:220:14: error: expected identifier before '(' token > int c = cf->fgetc(cf); > ^ > config.c:220:14: error: expected statement before ')' token > int c = cf->fgetc(cf); > ^ > config.c:220:14: error: expected statement before ')' token > int c = cf->fgetc(cf); > ^ > config.c:224:11: error: expected identifier before '(' token > c = cf->fgetc(cf); > ^ > make: *** [config.o] Error 1 > > The problem appear to be that fgetc is a macro in uClibc. > > Any idea what the proper fix for this would be? Is it really a good idea to > use macro instead of function for fgetc/fputc?
This is a bug in git. Per ISO C, any function defined in the standard library can also be defined as a function-like macro, provided the underlying function exists (the application is allowed to #undef the macro) and the macro version properly protects its arguments and evaluates each one exactly once. A correct application would either #undef fgetc or avoid using the same name as a standard function. Rich _______________________________________________ uClibc mailing list uClibc@uclibc.org http://lists.busybox.net/mailman/listinfo/uclibc