Casting a postdecrement operand

Wayne Throop throopw at dg_rtp.UUCP
Sun Jun 15 04:59:14 AEST 1986


> davidsen at steinmetz.UUCP (Davidsen)

[discussing the illegal C expression ((struct abc *)cbap)++]

> The variable 'cbap' is a pointer.
        Correct.

> The cast '(struct abc *)' is a pointer cast.
        Correct.

> I can use '((struct abc *)cbap)' with indirects and subscripts
        Correct.

> and anywhere that I can use an Lvalue,
        "Non sequitur.  Your thinking is un-co-ordinated."

Wrong.  I say again, ****WRONG****.  The "lvaluehood" of an expression
is *NOT* *NOW*, and *HAS* *NEVER* *BEEN*, implied by the legality of the
use of that expression in pointer arithmetic and indirection.

You don't seem to know what an lvalue is, nor do you seem to know what
entities in C are lvalues.  An lvalue is an expression that can appear
as the left subexpression of an assignment operator.  Saying that a cast
is an lvalue is as nonsensical as saying that (a+b) is an lvalue, or
that (&x) is an lvalue.  Casts do *NOT* yeild lvalues.  They *DO* *NOT*
*NOW*, and they *NEVER* *HAVE*.  God willing they *NEVER* *WILL*.

I appologize for my vehemence, but this issue comes up over and over and
over and over and over and over and over and over and over.   And over.
I am using caps and stars to try to *GET* *YOUR* *ATTENTION*!!!!!
*HEY*!!!  *ANYBODY* *IN* *THERE*????  *CASTS* *NEVER* *YIELD*
*LVALUES*!!!!!!!!!!!!   *NEVER*!!!!!!!! ********* N E V E R *******!!!!
**N**O**T**  **E**V**E**R**!!!!!!!!!!!!

I have posted references in K&R and the ANSI draft standard that support
my position.  I have posted a reference to a recent Dr Dobbs where
the issue was discussed in endless boring detail.  Those that think
otherwise say things like this:

> so I really believe that the expression is legal.

Great.  And my aunt Martha believes pigs can fly.  She is wrong.  And so
are you.  My appologies if my prior postings simply didn't arive at your
site.  My appologies for any offense I may have given.  And in general,
profuse appology for my state of extreme annoyance and exasperation.
But, confound it, I am right about this, and you are wrong, and yet
people that hold this incorrect opinion keep posting and posting and
posting and posting.  It's a conspiracy, I tell you!  You're all out to
*GET* me!  But you won't... no, I won't *LET* you!  Get them *OFF* me,
get them **OFF**, spiders, can't you *SEE* them, they're crawling
all ****OVER**** me....

AAAAAAAUUUUUUUGGGGGGGHHHHHHH!!!!!!!!

--
Well, I feel a *little* better after the sedation.
But shouting *does* exhaust one so.

--
What's that?  You say you want the references again?  They were

  - K&R, sections 7.2 and 5 in the reference part.
  - Harbison and Steele, first few paragraphs of chapter 7.
  - ANSI draft standard, section 3.4.
  - Dr. Dobbs Journal, May 1986, page 20, under the heading
        "Beating Dead Horses"  (most appropriate!)
-- 
Wayne Throop      <the-known-world>!mcnc!rti-sel!dg_rtp!throopw



More information about the Comp.lang.c mailing list