Why are character arrays special (equal rights for structs)
Henry Spencer
henry at utzoo.uucp
Thu Feb 9 08:33:02 AEST 1989
In article <19742 at uflorida.cis.ufl.EDU> thoth at beach.cis.ufl.edu () writes:
>... The question is, what does the standard say about
>structure and array constants (and arrays of structure
>constants, etc.)?
Absolutely nothing. The idea was, as I understand it, proposed a number
of times, unsuccessfully.
>I think that to not have the capability
>to declare something like that on the fly is crippled.
Alas, we'll just have to go on using our crippled language (in which many
millions of lines of code have been written quite successfully).
>If
>it isn't in the standard, somebody get it in there. If it
>IS in the standard, somebody get GNU to add it to their
>compiler...
You have things in the wrong order: ANSI standards committees are in the
business of standardizing ideas that have already been tried out and found
to be workable. (There are a number of things in ANSI C that were never
tried in *Unix* C compilers, but very few things that haven't been tried
somewhere by somebody in some C compiler.) Designing a language -- or even
a single language feature -- is tricky, and feedback from real use of real
implementations is important. The alternative, having a standards committee
get the bit between its teeth and design something out of thin air, tends
to yield most unpleasant results. (X3J11's one major foray in that direction
was the disastrous "noalias", fortunately since deleted.)
I think such a thing already exists in the GNU compiler, actually, and if
experience with it is sufficiently positive, it might perhaps end up in the
next revision of the standard. It's much too late now to mess with the
about-to-be-issued current version.
--
Allegedly heard aboard Mir: "A | Henry Spencer at U of Toronto Zoology
toast to comrade Van Allen!!" | uunet!attcan!utzoo!henry henry at zoo.toronto.edu
More information about the Comp.lang.c
mailing list