delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/05/15/20:16:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <do_not_have AT bitfoad DOT cmm>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: error: invalid lvalue in increment
Date: Mon, 15 May 2006 20:15:10 -0400
Organization: Vmunix.org
Lines: 42
Message-ID: <e4b5he$1b14$1@defiant.vmunix.org>
References: <44670d4b$0$3880$91cee783 AT newsreader01 DOT highway DOT telekom DOT at>
NNTP-Posting-Host: c-68-60-59-250.hsd1.mi.comcast.net
X-Trace: defiant.vmunix.org 1147738478 44068 68.60.59.250 (16 May 2006 00:14:38 GMT)
X-Complaints-To: usenet AT defiant DOT vmunix DOT org
NNTP-Posting-Date: Tue, 16 May 2006 00:14:38 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Florian Xaver" <wosrediinanatour AT aon DOT at> wrote in message
news:44670d4b$0$3880$91cee783 AT newsreader01 DOT highway DOT telekom DOT at...
> What is wrong?
>
> ...
> (l_text)d += 1;
> *d = GetKey(App) & 0xFF;
> ...
>

The behavior was deprecated.  You can no longer cast lvalues in GCC.

You might unrolling the assignment, so the cast is an rvalue, like one of
these:

d=(pointertypeofd *)((l_text)d+1);

d=(typeofd)((l_text)d+1);

where "pointertypeofd" or "typeofd" is the proper cast needed for the
declared type of d...


From "GCC 3.4 Release Series Changes, New Features, and Fixes",
"The cast-as-lvalue extension has been removed for C++ and deprecated for C
and Objective-C. In particular, code like this:
        int i;
        (char) i = 5;

or this:

        char *p;
        ((int *) p)++;

is no longer accepted for C++ and will not be accepted for C and Objective-C
in a future version."


Rod Pemberton


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019