Path: utzoo!telly!ddsw1!mcdchg!rutgers!mailrus!bbn!rochester!pt.cs.cmu.edu!k.gp.cs.cmu.edu!jgm From: jgm@k.gp.cs.cmu.edu (John Myers) Newsgroups: gnu.gcc Subject: Re: left-hand side cast Message-ID: <3591@pt.cs.cmu.edu> Date: 16 Nov 88 17:41:21 GMT References: <2100@kalliope.rice.edu> Distribution: gnu Organization: Carnegie-Mellon University, CS/RI Lines: 31 "Casts as lvalues" is the one extension that I seriously object to. The semantics are not obvious (I had to read the description in the manual three times before I understood what was going on) and are certainly not what the people who have asked for lvalue casts in comp.lang.c were asking (which is good--they generally didn't know what they were talking about anyway.) The extension adds no power to the language, given the typeof operator. (int)a = b is the same as: (int) (a = (typeof a) (int) b) After having looked at a piece of code that used this extension and had also #ifdef's for compilers without this extension, I must say that the traditional code is more readable. (If anyone is interested, the other extension that I object to, but not quite so strongly is "Arithmetic on void-pointers and function pointers". If someone is manipulating byte-sized quantities, they should make it obvious by casting the pointers to char and back. I'd rather have the compiler yell at me when I try to manipulate a void pointer--those buggers are SUPPOSED to be opaque.) -- _.John G. Myers Internet: John.Myers@cs.cmu.edu LoseNet: ...!seismo!inhp4!wiscvm.wisc.edu!give!up "The world is full of bozos. Some of them even have PhD's in Computer Science" --