ANSI C idea: structure literals (and short constants)

Henry Spencer henry at utzoo.uucp
Sat Mar 12 07:29:56 AEST 1988


> I fail to see that the committee has drawn and observed "need" as
> a clear boundary for what should be standardized.

They have tried.  Sometimes they've let their enthusiasm run away with
them; these are reprehensible lapses that should not be considered an
excuse to others to do likewise!

> > [expletive deleted]  Speaking as a user and an implementor, this is an
> > abortion if there ever was one.
> 
> Thank you for the feedback.  But I wonder if you would be so kind as to
> elaborate on this comment...

*Why* introduce a new notion of something that doesn't have a type (actually
it does have a type, some sort of curious mix of the types of the things
inside it) when it is easy to invent a syntax (or borrow the one from the
GNU compiler) that specifies the type?!?

> > ... probably the GNU compiler's approach, which avoids this
> > hideous botch entirely.
> 
> I wonder if you would mind summarizing that approach for those of us who
> don't have access to that compiler's source code.

As I recall it -- I have not studied the GNU compiler closely yet -- the
technique used is a sort of "cast with an initializer".

> At any rate, your comment seems to imply that this is existing practice,
> so I am having trouble seeing why this is a topic that should not be
> standardized.

"Existing practice" means that it has been out there for a while, that
people other than its implementors have used it at some length, and that
it has been used for more than just toy programs.  That does not happen
overnight, the GNU compiler is very new, and the draft standard is
(theoretically) in virtually its final state.
-- 
Those who do not understand Unix are |  Henry Spencer @ U of Toronto Zoology
condemned to reinvent it, poorly.    | {allegra,ihnp4,decvax,utai}!utzoo!henry



More information about the Comp.lang.c mailing list