Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Oct 1998 10:44:17 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Dan Nelson <dnelson@emsphone.com>, Alan Green <alan_green@csi.com>, freebsd-questions@FreeBSD.ORG, M.Hessling@qut.edu.au
Subject:   Re: ANSI C Compiler?
Message-ID:  <19981002104417.L24146@freebie.lemis.com>
In-Reply-To: <19981001151410.A11834@emsphone.com>; from Dan Nelson on Thu, Oct 01, 1998 at 03:14:10PM -0500
References:  <000201bded65$b26cda80$5e7ae8c3@aardvark> <19981001151410.A11834@emsphone.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Thursday,  1 October 1998 at 15:14:10 -0500, Dan Nelson wrote:
> In the last episode (Oct 01), Alan Green said:
>> Is there a freeware ANSI C compiler available for FreeBSD.
>>
>> I'm trying to compile Regina REXX for my FreeBSD system and it tells
>> me that the C compiler that's installed doesn't support
>> ANSI.?!?!?!?!?
>
> (The easy solution is to simply run "CC=cc ./configure". more detailed
> info for Mr Hessling follows)
>
> Whoa weird :)
>
> loading cache ./config.cache
> checking for one of the following C compilers: c89 acc gcc cc... using /usr/bin/c89
> checking for gcc... (cached) c89

This says that some previous run of ./configure has chosen c89.  To
quote from the man page:

DESCRIPTION
     This is the name of the C language compiler as required by the IEEE
     Std1003.2 (``POSIX.2''). standard.

In other words, this is POSIX.2, not ANSI.

To get rid of this problem, rm config.cache and try again.

Also make sure that you don't have c89 set as the compiler in your CC
environment variable.

> checking whether the C compiler (c89  ) works... yes
> checking whether the C compiler (c89  ) is a cross-compiler... no
> checking whether we are using GNU C... yes
> checking whether c89 accepts -g... yes
> checking if compiler supports ANSI prototypes... no
> configure: error: Regina requires an ANSI compiler; cannot continue
>
> I don't think ./configure should be looking for c89 at all.
>
> The reason the configure tests fail is that c89 does NOT take -O2 as an
> argument; see http://www.opengroup.org/onlinepubs/7908799/xcu/c89.html.
>
> Also, the config line on like 889 is wrong (see
> http://www.opengroup.org/onlinepubs/7908799/xbd/utilconv.html#usg ,
> guideline 9):
>
> ac_compile='$ac_cv_prog_CC conftest.$ac_ext $CFLAGS $CPPFLAGS -c1>&5 2>&5'
>
> should be:
>
> ac_compile='$ac_cv_prog_CC $CFLAGS $CPPFLAGS conftest.$ac_ext -c1>&5 2>&5'
>
> There are a bunch of other c89-related errors; c89 is a strict POSIX
> compiler with no extensions, and probably shouldn't even be tested for.

Greg
--
See complete headers for address, home page and phone numbers
finger grog@lemis.com for PGP public key

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?19981002104417.L24146>