I'm getting a compile error on cvs tip.

gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations 
-I../../../../src/include  -DPKGLIBDIR=\"/usr/local/pgsql/lib\" 
-DDLSUFFIX=\".so\"  -c -o dfmgr.o dfmgr.c -MMD
dfmgr.c:330:1: directives may not be used inside a macro argument
dfmgr.c:330:1: unterminated argument list invoking macro "strcspn"
make[4]: *** [dfmgr.o] Error 1

Looks like it was caused here:

http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/fmgr/dfmgr.c.diff?r1=1.57&r2=1.58

Joe


Sat, 05 Apr 2003 11:14:27 -0800
Joe Conway <mail@joeconway.com>
compile error in cvs tip
OK, patch applied.  I am a little surprised your compiler complained. 
Seems your strcspn() is actually a macro, not a function call.  What
OS/compiler are you using?

---------------------------------------------------------------------------

Joe Conway wrote:
> I'm getting a compile error on cvs tip.
> 
> gcc -O2 -g -Wall -Wmissing-prototypes -Wmissing-declarations 
> -I../../../../src/include  -DPKGLIBDIR=\"/usr/local/pgsql/lib\" 
> -DDLSUFFIX=\".so\"  -c -o dfmgr.o dfmgr.c -MMD
> dfmgr.c:330:1: directives may not be used inside a macro argument
> dfmgr.c:330:1: unterminated argument list invoking macro "strcspn"
> make[4]: *** [dfmgr.o] Error 1
> 
> Looks like it was caused here:
> 
> http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/backend/utils/fmgr/dfmgr.c.diff?r1=1.57&r2=1.58
> 
> Joe
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Index: src/backend/utils/fmgr/dfmgr.c
===================================================================
RCS file: /cvsroot/pgsql-server/src/backend/utils/fmgr/dfmgr.c,v
retrieving revision 1.58
diff -c -c -r1.58 dfmgr.c
*** src/backend/utils/fmgr/dfmgr.c	4 Apr 2003 20:42:12 -0000	1.58
--- src/backend/utils/fmgr/dfmgr.c	5 Apr 2003 19:51:03 -0000
***************
*** 326,338 ****
  	if (name[0] != '$')
  		return pstrdup(name);
  
- 	macroname_len = strcspn(name + 1,
  #ifndef WIN32
! 		"/"
  #else
! 		"/\\"
  #endif
- 		) + 1;
  
  	if (strncmp(name, "$libdir", macroname_len) == 0)
  		replacement = PKGLIBDIR;
--- 326,336 ----
  	if (name[0] != '$')
  		return pstrdup(name);
  
  #ifndef WIN32
! 	macroname_len = strcspn(name + 1, "/") + 1;
  #else
! 	macroname_len = strcspn(name + 1, "/\\") + 1;
  #endif
  
  	if (strncmp(name, "$libdir", macroname_len) == 0)
  		replacement = PKGLIBDIR;
Sat, 5 Apr 2003 14:52:54 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: compile error in cvs tip
Bruce Momjian wrote:
> OK, patch applied.  I am a little surprised your compiler complained. 
> Seems your strcspn() is actually a macro, not a function call.  What
> OS/compiler are you using?
> 

# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-113)

Joe


Sat, 05 Apr 2003 11:56:25 -0800
Joe Conway <mail@joeconway.com>
Re: compile error in cvs tip