Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uflorida!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: A cast pointer is NOT an lvalue!? (ANSI C) Keywords: X3J11, pointers, cast, lvalue Message-ID: <8663@smoke.ARPA> Date: 9 Oct 88 00:32:50 GMT References: <479@midgard.mn.org> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <479@midgard.mn.org> dal@syntel.UUCP (Dale Schumacher) writes: > value = *((long *) argp)++; Rather than answer your questions directly, let me explain what is wrong with this attempted usage. A cast is the same as assignment to an unnamed temporary variable. The ++ in your example would have to increment the temporary variable, not the original variable argp. That is clearly not what you wanted. The result of a cast has never been an lvalue for just this reason. Some compilers have been sloppy about this. Anyway, you should be using either the old or the new macros to pick up arguments from a variable argument list. What you were trying to do cannot be done portably any other way.