Re: testing for usable C compiler

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: testing for usable C compiler
Date: 2003-09-04 05:15:41
Message-ID: 15132.1062652541@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Tom Lane writes:
>> Couldn't we just throw a prototyped function into that test program?

> The standard Autoconf prototype test is pretty involved (see
> AC_PROG_CC_STDC in /usr/local/share/autoconf/autoconf/c.m4 or whatever).

Yikes. And that's really of zero value to us, since we already have all
that knowledge (about which CFLAGS to use per-platform) embedded in our
template files.

> Maybe you can come up with a smaller test for now that fails on the
> lame-excuse compiler on HP-UX?

It's not hard.

$ cat test.c
int test(int x)
{
return x;
}
-- cc is the "good" compiler
$ cc -c test.c
cc: "test.c", line 1: error 1705: Function prototypes are an ANSI feature.
$ cc -Ae -c test.c
$
-- /usr/ccs/bin/cc is bogus
$ /usr/ccs/bin/cc -c test.c
(Bundled) cc: "test.c", line 1: error 1705: Function prototypes are an ANSI feature.
$ /usr/ccs/bin/cc -Ae -c test.c
(Bundled) cc: warning 480: The -A option is available only with the C/ANSI C product; ignored.
(Bundled) cc: "test.c", line 1: error 1705: Function prototypes are an ANSI feature.
$

> But: What's the error message going to be? Is "compiler does not accept
> prototypes" going to be clearer for the user than what he gets now?

For sure. See the discussion a day or two back --- with the bundled
compiler, the first sign of trouble is that configure fails to determine
the argument types for accept(). Not very helpful :-(

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-09-04 05:23:28 Re: Stats Collector Error 7.4beta1 and 7.4beta2
Previous Message Matthew T. O'Connor 2003-09-04 05:10:55 Re: Stats Collector Error 7.4beta1 and 7.4beta2