Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Why is this not a modifiable lvalue.

Reply
Thread Tools

Re: Why is this not a modifiable lvalue.

 
 
Micah Cowan
Guest
Posts: n/a
 
      06-28-2003
"David Crayford" <(E-Mail Removed)> writes:

> I ported some code which compiles ok on my PC using GCC but fails using the
> mainframe OS/390
> and z/OS compilers.
>
> static void exchange(void *a, void *b, size_t size) {
>
> <snip>
>
> *(((int *)a)++) = *((int *)b);
>
> produces the following compiler error
>
> Operand must be a modifiable lvalue
>
> The cast should take care of that, shouldn't it?


If you compile using GCC with the -pedantic flag, you'll at least get
the required diagnostic (warning) before GCC continues on to finish
compiling.

To get a (mostlhy) conformant C implementation from GCC, you need to
at least compile with the -ansi and -pedantic flags. Many here would
recommend using:

gcc -O2 -W -Wall -ansi -pedantic

HTH,
Micah
 
Reply With Quote
 
 
 
 
CBFalconer
Guest
Posts: n/a
 
      06-28-2003
Micah Cowan wrote:
>

.... snip ...
>
> To get a (mostlhy) conformant C implementation from GCC, you
> need to at least compile with the -ansi and -pedantic flags.
> Many here would recommend using:
>
> gcc -O2 -W -Wall -ansi -pedantic


I have recently taken to adding -wwrite-strings.

--
Chuck F ((E-Mail Removed)) ((E-Mail Removed))
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
lvalue -modifiable and non-modifiable Kavya C Programming 3 11-06-2006 10:33 PM
Re: Why is this not a modifiable lvalue. Dan Pop C Programming 6 06-30-2003 02:19 PM
Re: Why is this not a modifiable lvalue. Martin Ambuhl C Programming 0 06-27-2003 06:17 PM
Re: Why is this not a modifiable lvalue. Simon Biber C Programming 0 06-27-2003 11:12 AM



Advertisments