questions about C standards

Henry Spencer henry at utzoo.uucp
Wed Sep 21 04:18:14 AEST 1988


In article <8809171754.AA02615 at lakisis.umd.edu> mbp at LAKISIS.UMD.EDU ("Mark Phillips ", RD Goldman) writes:
>(1) Where can I find ANSI documents containing the current (if any)
>    and proposed standards?  Are they published in a book or journal?

Global Engineering Documents (714)261-1455 should be willing to sell you
the third-public-review draft.  Said public review is over, but there was
an intent that it make only editorial changes and leave the content alone.
Assuming that no disasters surface, the results of the review should become
a real live ANSI standard in the not-too-distant future.  At that point it
will become possible to buy the thing from ANSI in Washington.

Neither Global nor ANSI is a particularly cheap source of paper, by the way.

>(2) Is it considered acceptable to do the following things with
>    structures or unions?
>	(a) pass them (by value) to functions
>	(b) have functions which return them
>	(c) assign them (=)

These are all proper and legitimate constructs, and have been for quite a
while.

>	(d) test them (structures only) for equality with ==

No.  This was proposed to X3J11, I believe, but it was not accepted.

>    .... I am wondering whether I might run into problems
>    porting my programs to other machines in the future if I do
>    these things.

There is no limit to how stupid compiler writers can be if given the chance,
but any compiler which doesn't implement struct passing, returning, and
assignment is seriously broken.  I.e., there is no way to be sure that you
won't someday end up dealing with a broken compiler, but there will be no
serious debate about whether it is broken or not.
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list