Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C89

5 views
Skip to first unread message

Bill Coffman

unread,
Oct 21, 2004, 2:25:18 PM10/21/04
to Perl 6 Internals
I read somewhere that the requirement for parrot code is that it
should be compliant with the ANSI C'89 standard. Can someone point me
to a description of the C89 spec, so I can make sure my reg_alloc.c
patch is C89 compliant?

Thanks,
- Bill

Dan Sugalski

unread,
Oct 21, 2004, 2:51:15 PM10/21/04
to Bill Coffman, Perl 6 Internals

I don't think the ANSI C89 spec is freely available, though I may be
wrong. (Google didn't find it easily, but I don't always get along
well with Google) If the patch builds without warning with parrot's
standard switches then you should be OK. (ANSI C89 was the first big
rev of C after the original K&R C. If you've got the second edition
or later of the K&R C book, it uses the C89 spec)
--
Dan

--------------------------------------it's like this-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Michael G Schwern

unread,
Oct 21, 2004, 3:00:57 PM10/21/04
to Dan Sugalski, Bill Coffman, Perl 6 Internals
On Thu, Oct 21, 2004 at 02:51:15PM -0400, Dan Sugalski wrote:
> At 11:25 AM -0700 10/21/04, Bill Coffman wrote:
> >I read somewhere that the requirement for parrot code is that it
> >should be compliant with the ANSI C'89 standard. Can someone point me
> >to a description of the C89 spec, so I can make sure my reg_alloc.c
> >patch is C89 compliant?
>
> I don't think the ANSI C89 spec is freely available, though I may be
> wrong. (Google didn't find it easily, but I don't always get along
> well with Google) If the patch builds without warning with parrot's
> standard switches then you should be OK. (ANSI C89 was the first big
> rev of C after the original K&R C. If you've got the second edition
> or later of the K&R C book, it uses the C89 spec)

Its available for the low, low price of $18. Makes a great stocking stuffer.
Or frightening accessory this Halloween!
http://webstore.ansi.org/ansidocstore/product.asp?sku=INCITS%2FISO%2FIEC+9899%2D1999

(That's the C99 spec but it should be clear from it what was C89 and what's
been introduced with C99).


--
Michael G Schwern sch...@pobox.com http://www.pobox.com/~schwern/
Beef Coronary

Jeff Clites

unread,
Oct 22, 2004, 1:41:36 AM10/22/04
to Bill Coffman, Perl 6 Internals
On Oct 21, 2004, at 11:51 AM, Dan Sugalski wrote:

> At 11:25 AM -0700 10/21/04, Bill Coffman wrote:
>> I read somewhere that the requirement for parrot code is that it
>> should be compliant with the ANSI C'89 standard. Can someone point me
>> to a description of the C89 spec, so I can make sure my reg_alloc.c
>> patch is C89 compliant?
>
> I don't think the ANSI C89 spec is freely available, though I may be
> wrong. (Google didn't find it easily, but I don't always get along
> well with Google) If the patch builds without warning with parrot's
> standard switches then you should be OK. (ANSI C89 was the first big
> rev of C after the original K&R C. If you've got the second edition or
> later of the K&R C book, it uses the C89 spec)

Also, if you're compiling with gcc, then you can pass "-std=c89" to the
compiler to enforce that particular standard. (Apparently--though I
haven't tried it.) I believe "-ansi" does the same thing.

JEff

Bill Coffman

unread,
Oct 28, 2004, 10:22:02 PM10/28/04
to Jeff Clites, Perl 6 Internals
Thanks for the info...

Apparently,

gcc -ansi -pedantic

is supposed to be ANSI C '89. Equiv to -std=c89. Also, my
Configure.pl generated make file uses neither -ansi nor -pedantic. I
do have access to a K&R C v2, but it doesn't look like it's going to
match the actual practice. Oh well. So long, as my code works, I'm
happy.

Incidentally, I tried adding -ansi and -pedantic and I got lots of
warnings, like "long long" not supported by ANSI C'89, etc. (how can
you do 64 bit ints then?). I also got errors that caused outright
failure. Perhaps it's best to forget the whole C'89 thing. But maybe
someone should remove that from the documentation? Just a thought.

-Bill

Leopold Toetsch

unread,
Oct 29, 2004, 3:12:58 AM10/29/04
to Bill Coffman, perl6-i...@perl.org
Bill Coffman <bill.c...@gmail.com> wrote:
> Thanks for the info...

> Apparently,

> gcc -ansi -pedantic

> is supposed to be ANSI C '89.

Not really. It's pedantic ;)

> Incidentally, I tried adding -ansi and -pedantic and I got lots of
> warnings, like "long long" not supported by ANSI C'89, etc. (how can
> you do 64 bit ints then?).

A C compiler on a 64-bit machine uses long.

> ... I also got errors that caused outright


> failure. Perhaps it's best to forget the whole C'89 thing.

Not the C'89 thing, but the "-ansi" thing of gcc.

> -Bill

leo

Bryan Donlan

unread,
Oct 29, 2004, 9:02:05 AM10/29/04
to Bill Coffman, Jeff Clites, Perl 6 Internals
On Thu, 28 Oct 2004 19:22:02 -0700, Bill Coffman <bill.c...@gmail.com> wrote:
> Thanks for the info...
>
> Apparently,
>
> gcc -ansi -pedantic
>
> is supposed to be ANSI C '89. Equiv to -std=c89. Also, my
> Configure.pl generated make file uses neither -ansi nor -pedantic. I
> do have access to a K&R C v2, but it doesn't look like it's going to
> match the actual practice. Oh well. So long, as my code works, I'm
> happy.
>
> Incidentally, I tried adding -ansi and -pedantic and I got lots of
> warnings, like "long long" not supported by ANSI C'89, etc. (how can
> you do 64 bit ints then?). I also got errors that caused outright
> failure. Perhaps it's best to forget the whole C'89 thing. But maybe
> someone should remove that from the documentation? Just a thought.

I thought long long was only defined in C99, not C89?

--
bd

0 new messages