Re: UnixWare 7.1.3 (BETA), C99 compiler, current CVS, error...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: UnixWare 7.1.3 (BETA), C99 compiler, current CVS, error...
Date: 2002-10-26 15:30:55
Message-ID: 27859.1035646255@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Larry Rosenman <ler(at)lerctr(dot)org> writes:
>> so the text of the message is surely not what they are really
>> complaining about? Or is the compiler broken?
> I'll ask, it is Beta (although the Compiler has done this since the C99
> functionality was added, and it causes a LOT of open source stuff to
> require -Xb).

After reading a little further, it seems that the brain damage is in the
standard, not the compiler :-(. It looks like C99's notion of a
function that is both global and inline is that you must provide *two*
definitions of the function, one marked inline and one not; moreover,
these must appear in separate translation units. What in the world were
those people smoking? That's a recipe for maintenance problems (edit
one definition, forget to edit the other), not to mention completely at
variance with the de facto standard behavior of inline that's been
around for a long time.

My inclination is to change the code for ApplySortFunction to look like

#if defined(__GNUC__)
__inline__
#endif
int32
ApplySortFunction

so that the inline optimization only gets done for gcc, which we know
interprets inline sanely. Anyone see a better answer?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Doug McNaught 2002-10-26 16:05:24 Re: Request for supported platforms
Previous Message Larry Rosenman 2002-10-26 15:09:47 Re: UnixWare 7.1.3 (BETA), C99 compiler, current CVS,