preprocessor/5177: Problem with gcc-3.0.2 CPP and #define

cmadams@hiwaay.net cmadams@hiwaay.net
Sat Dec 22 19:06:00 GMT 2001


>Number:         5177
>Category:       preprocessor
>Synopsis:       Problem with gcc-3.0.2 CPP and #define
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 22 11:56:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Chris Adams
>Release:        3.0.2
>Organization:
>Environment:
System: OSF1 bugs.hiwaay.net V5.1 1885 alpha
Machine: alpha
	AlphaServer 1000A 5/300, Compaq Tru64 Unix 5.1A
host: alphaev5-dec-osf5.1
build: alphaev5-dec-osf5.1
target: alphaev5-dec-osf5.1
configured with: /usr/users/cmadams/ftp/gcc-3.0.2/configure --prefix=/usr/users/cmadams/strap --disable-shared --disable-nls --enable-languages=c,c++
>Description:
	I am trying to build RPM 4.0.3 (http://www.rpm.org/).  The compile
	stops in rpmdb/db3.c at a line that calls "db->stat()" (db is a DB*
	from the Berkeley DB library included with RPM):

    rc = db->stat(db, &dbi->dbi_stats, flags);

	This generates an error from CPP about the number of arguments to
	stat:

db3.c:601:45: macro "stat" passed 3 arguments, but takes just 2

	The Tru64 include file /usr/include/sys/stat.h includes the line
	(this is the only #define of a stat macro that I can find included
	from the file above):

#       define stat(__a,__b) _F64_stat(__a,__b)

	It looks like the preprocessor is trying to use the define of stat
	in the db->stat line, which is not correct.  The Tru64 CPP has no
	problem with this code.

>How-To-Repeat:
	Try to build rpm-4.0.3 on Tru64 5.1A with gcc-3.0.2.
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list