Assignment Ops and Side Effects

Doug Gwyn gwyn at smoke.brl.mil
Sat Apr 13 07:33:46 AEST 1991


In article <18393 at crdgw1.crd.ge.com> volpe at camelback.crd.ge.com (Christopher R Volpe) writes:
>3.2.1.1: A char ... may be used in an expression wherever an int or
>                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>This appears to say that this conversion occurs in any expression
>context, subject to explicit exceptions made elsewhere.

That's why you have to read the whole standard.  On the same page, at
the beginning of section 3.2, it explains when the conversions apply.

The result type for simple assignment is well specified.  There is
no license for applying any further conversion while evaluating
"sizeof(c=1)" EVEN ACCORDING TO YOUR ATTEMPT, unless you wish
"sizeof char_variable_name" to also be affected, which is clearly not
desirable.

>I didn't notice the footnote. Other people were able to point this 
>out to me in a polite, civilized, non-hostile, and non-insulting manner.
>With all due respect, perhaps you could learn to chill out a bit. Not all
>of us were on the committee and not all of us have the whole document
>memorized and not all of us are so perfect as to not be able to miss a
>footnote. 

The footnote is not part of the standard.  It was probably added in
response to some public review comment, maybe over the Redactor's
protests (several footnotes fell into that category), but was
considered technically inessential to a correct specification.

My response was civil, but if you choose to take it as an insult then
you're welcome to do so.

>|>I see no room for for thinking that any sort of conversion should be
>|>performed.
>I think you mean, "I see no room for not having as thorough an 
>understanding of the language as I have."

No, I meant what I said.  See my above analysis of the consequences of
carrying through what you had proposed as an interpretation.  I do
expect you to think through the full consequences of any such notion
when attempting to evaluate whether it makes sense or not.



More information about the Comp.lang.c mailing list