[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Problem build 4.0.3 on Tru64 5.1A



In regard to: Re: Problem build 4.0.3 on Tru64 5.1A, Chris Adams said (at...:

>To follow up to my own message (since nobody else has):

I started to, since I was able to compile 4.0.3 with the vendor compiler
on 5.1 (I don't have 5.1A at this point), but I got interrupted.

>Once upon a time, Chris Adams <cmadams@hiwaay.net> said:
>> I am trying to build rpm 4.0.3 on a new install of Compaq Tru64 5.1A.  I
>> built gcc-3.0.2 and zlib-1.1.3 (in a special directory; I'm trying to
><snip>
>> db3.c:601:45: macro "stat" passed 3 arguments, but takes just 2
>
>This happens because on Tru64, stat() is defined as a macro (with two
>arguments).  The referenced line in rpmdb/db3.c is:
>
>    rc = db->stat(db, &dbi->dbi_stats, flags);
>
>which the C preprocessor tries to expand with the stat() macro.

Hmmm, I don't see any warnings related to this from the Compaq C compiler
or preprocessor.  That means either:

1) Gcc's cpp is doing something it *shouldn't* be by treating
db->stat() as a call to the macro `stat()'.

or

2) Compaq's cpp isn't doing something it should be (either warning about
the questionable use if it's actually expanding the stat above as the
stat() macro, or perhaps it's not expanding the db->stat as the stat macro
and it should be {I'm skeptical about *that*, though}).


After just preprocessing the file, it looks to me like the Compaq compiler
is not expanding the stat() call, which seems correct to me FWIW.

My guess is that the gcc fixincludes or cpp is getting tripped up by the
macro chicanery (and possibly the `pragma extern_prefix') in sys/stat.h.

>I can't see a way around this except to "#undef stat" before the line
>above (but then if someone wants to use stat() later in the same file it
>will be broken).  Any suggestions?

Have you tried forcing gcc into `--ansi' mode for compiling RPM?  Comments
in the sys/stat.h header seem to indicate that might change how the macros
are visible to the cpp.

Since this affects Sleepycat DB primarily, you might want to check their
web site and see if they mention anything about this problem.

Tim
-- 
Tim Mooney                              mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services         (701) 231-1076 (Voice)
Room 242-J6, IACC Building              (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []