Can an enumerator be assigned to an int?
Larry Jones
scjones at sdrc.UUCP
Sun May 27 04:54:25 AEST 1990
In article <16728 at haddock.ima.isc.com>, karl at haddock.ima.isc.com (Karl Heuer) writes:
> In article <1421 at sdrc.UUCP> gcglan at sdrc.UUCP (Frank Glandorf) writes:
> > a=CIRCLE;
> >%CC-W-ENUMCLASH, Mismatched enum type in "=" operation.
> ^
> I presume from this codeletter that the implementation did not in fact
> terminate the compilation as a result of the mismatch.
>
> 2.1.1.3 footnote 6: "Of course, an implementation is free to produce any
> number of [warning] diagnostics". A.5 common warnings: "A value is given to
> an object of enumeration type other than by assignment of [something of the
> same enumeration type]."
>
> In diagnosing violations of the strong-enum model, the implementation is
> (a) legally in the right (as long as it is only a warning) and also (b)
> morally in the right (as long as there is an option to disable the warning).
You're right about (a) and I agree with you about (b) in
priciple, but I have to disagree in this specific case because of
the nature of warnings in Vax C. The fact that a warning was
issued is recorded in the object file and reiterated every time
you do anything with it like put it in a library or link to it.
Vax C has another category of messages (informational) which are
displayed, but not recorded in the object file which would be
more appropriate for this kind of message.
----
Larry Jones UUCP: uunet!sdrc!scjones
SDRC scjones at SDRC.UU.NET
2000 Eastman Dr. BIX: ltl
Milford, OH 45150-2789 AT&T: (513) 576-2070
"You know how Einstein got bad grades as a kid? Well MINE are even WORSE!"
-Calvin
More information about the Comp.std.c
mailing list