public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Error messages I don't understand
@ 2007-05-09 15:19 Bill McEnaney
  2007-05-09 15:31 ` kf
  2007-05-09 15:33 ` John Love-Jensen
  0 siblings, 2 replies; 7+ messages in thread
From: Bill McEnaney @ 2007-05-09 15:19 UTC (permalink / raw)
  To: gcc-help

Hi, everybody,

Since I'm a beginner in C, please help me revise command.c to make it
compile cleanly.  I don't how much of that 503-line program you'll need
to read, so I'm omitting it from this note. But if you'll estimate how
much of it I should show you, I'll show you that much of it. 

By the way, I'm running the latest version of gcc on a Sunblade 100
workstation.

Thanks so much for your help.

Bill

Script started on Sat 28 Apr 2007 12:30:11 PM EDT
%cd source
%gmake
gcc  -O2    -c -o command.o command.c
command.c: In function 'c_interp':
command.c:55: error: invalid lvalue in assignment
command.c: In function 'c_condition':
command.c:190: error: invalid lvalue in assignment
command.c:194: error: invalid lvalue in assignment
command.c: In function 'c_doall':
command.c:215: warning: incompatible implicit declaration of built-in
function 
'strlen'
gmake: *** [command.o] Error 1
%^D\b\bexit

script done on Sat 28 Apr 2007 12:30:35 PM EDT




________________________________________________________________
Please visit a saintly hero.
http://www.jakemoore.org

"Pro-choice?"  Click here:
http://www.abortionno.com/Resources/pictures.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error messages I don't understand
  2007-05-09 15:19 Error messages I don't understand Bill McEnaney
@ 2007-05-09 15:31 ` kf
  2007-05-09 15:33 ` John Love-Jensen
  1 sibling, 0 replies; 7+ messages in thread
From: kf @ 2007-05-09 15:31 UTC (permalink / raw)
  To: gcc-help; +Cc: Bill McEnaney

On 5/9/07, Bill McEnaney <bill@rkirkpat.net> wrote:
> Hi, everybody,
>
> Since I'm a beginner in C, please help me revise command.c to make it
> compile cleanly.  I don't how much of that 503-line program you'll need
> to read, so I'm omitting it from this note. But if you'll estimate how
> much of it I should show you, I'll show you that much of it.
>
> By the way, I'm running the latest version of gcc on a Sunblade 100
> workstation.
>
> Thanks so much for your help.

Probably you have some legacy code that uses some casting tricks in
the left-hand side of the operand... But lvalue casting was a gcc
extension I think, and has been removed from the latest versions...
I.e. the code probably was 'correct' w.r.t. gcc at some point in
history, but never legal C... You have to use older gcc version, or
rewrite your code.

> Bill
>
> Script started on Sat 28 Apr 2007 12:30:11 PM EDT
> %cd source
> %gmake
> gcc  -O2    -c -o command.o command.c
> command.c: In function 'c_interp':
> command.c:55: error: invalid lvalue in assignment
> command.c: In function 'c_condition':
> command.c:190: error: invalid lvalue in assignment
> command.c:194: error: invalid lvalue in assignment
> command.c: In function 'c_doall':
> command.c:215: warning: incompatible implicit declaration of built-in
> function
> 'strlen'
> gmake: *** [command.o] Error 1
> %^D\b\bexit
>
> script done on Sat 28 Apr 2007 12:30:35 PM EDT
>
>
>
>
> ________________________________________________________________
> Please visit a saintly hero.
> http://www.jakemoore.org
>
> "Pro-choice?"  Click here:
> http://www.abortionno.com/Resources/pictures.html
>
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error messages I don't understand
  2007-05-09 15:19 Error messages I don't understand Bill McEnaney
  2007-05-09 15:31 ` kf
@ 2007-05-09 15:33 ` John Love-Jensen
  1 sibling, 0 replies; 7+ messages in thread
From: John Love-Jensen @ 2007-05-09 15:33 UTC (permalink / raw)
  To: Bill McEnaney, MSX to GCC

Hi Bill,

> command.c: In function 'c_interp':
> command.c:55: error: invalid lvalue in assignment

You have an invalid lvalue in your assignment on-or-near line 55.

> command.c: In function 'c_condition':
> command.c:190: error: invalid lvalue in assignment
> command.c:194: error: invalid lvalue in assignment

You have two more invalid lvalue in your assignments on-or-near lines 190
and 194.

> command.c: In function 'c_doall':
> command.c:215: warning: incompatible implicit declaration of built-in function
'strlen'

It appears you forgot to #include <string.h> at the top of your command.c
file.  Or your source re-declares strlen in an incompatible way.

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Error messages I don't understand
@ 2007-05-09 19:33 Bill McEnaney
  0 siblings, 0 replies; 7+ messages in thread
From: Bill McEnaney @ 2007-05-09 19:33 UTC (permalink / raw)
  To: gcc-help

Thanks, everybody.  I pagadded gcc-2.95.3, compiled the Progol
interpreter, and installed it.  The old casting tricks caused the
problems.  Thanks again.

Bill
________________________________________________________________
Please visit a saintly hero.
http://www.jakemoore.org

"Pro-choice?"  Click here:
http://www.abortionno.com/Resources/pictures.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error messages I don't understand
@ 2007-05-09 16:29 Bill McEnaney
  0 siblings, 0 replies; 7+ messages in thread
From: Bill McEnaney @ 2007-05-09 16:29 UTC (permalink / raw)
  To: John Love-Jensen; +Cc: gcc-help

Hi, Eljay,

Now I know what's going wrong.  My workstation is complaining because
the programmer tried to assign a value to an expanded macro, not to a
variable.  Since another gcc-help poster mentioned old, nonstandard
casting tricks that my worstation won't understand when it uses the
current version of gcc's C compiler, I'll just compile the program with
an old version of that compiler.  See what I get for always being up to
date.  :)

Cheers,
Bill

> Hi Bill,
> 
> What part of the error message don't you understand?
> 
> This kind of statement uses a valid lvalue, x:
> 
> int x;
> x = 2 + 3;
> 
> This kind of statement uses an invalid lvalue:
> 
> 5 = 2 + 3;
> 
> An lvalue is a value that can be assigned a value.  The term "lvalue"
means
> left value -- a value that can be on the left side of the assignment
> expression.
> 
> The code has a non-lvalue on the left side of the assignment expression.
> 
> Sincerely,
> --Eljay
> 
> 
> 
> 
> On 5/9/07 10:57 AM, "Bill McEnaney" <bill@rkirkpat.net> wrote:
> 
> > 
> > Hi, John,
> > 
> > Thanks.  Although it does help, I'm afraid it repeats what the messages
> > say.  I thought I would compile Progol with an older version of gcc's C
> > compiler because I've read transcripts of Progol sessions.  Since I have
> > read them, some compiler had compiled Progol.
> > 
> > By the way, I'm trying to compile an interpreter for the Progol
> > inductive-logic-programming language.  I do logic programming,
> > functional programming, and very little C programming.
> > 
> > Thanks again.
> > 
> > Bill
> >> Hi Bill,
> >> 
> >>> command.c: In function 'c_interp':
> >>> command.c:55: error: invalid lvalue in assignment
> >> 
> >> You have an invalid lvalue in your assignment on-or-near line 55.
> >> 
> >>> command.c: In function 'c_condition':
> >>> command.c:190: error: invalid lvalue in assignment
> >>> command.c:194: error: invalid lvalue in assignment
> >> 
> >> You have two more invalid lvalue in your assignments on-or-near
lines 190
> >> and 194.
> >> 
> >>> command.c: In function 'c_doall':
> >>> command.c:215: warning: incompatible implicit declaration of
> > built-in function
> >> 'strlen'
> >> 
> >> It appears you forgot to #include <string.h> at the top of your
command.c
> >> file.  Or your source re-declares strlen in an incompatible way.
> >> 
> >> HTH,
> >> --Eljay
> >> 
> >> 
> > 
> > ________________________________________________________________
> > Please visit a saintly hero.
> > http://www.jakemoore.org
> > 
> > "Pro-choice?"  Click here:
> > http://www.abortionno.com/Resources/pictures.html
> 
> 

________________________________________________________________
Please visit a saintly hero.
http://www.jakemoore.org

"Pro-choice?"  Click here:
http://www.abortionno.com/Resources/pictures.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error messages I don't understand
@ 2007-05-09 16:14 Bill McEnaney
  0 siblings, 0 replies; 7+ messages in thread
From: Bill McEnaney @ 2007-05-09 16:14 UTC (permalink / raw)
  To: John Love-Jensen, Bill McEnaney, MSX to GCC

Hi, John,

Thanks.  It does help, but I'm afraid it just repeats much that the
messages say.  I think I'll try to compile the program with gcc-2.95's C
compiler.  Gee, I think I'll go crazy if ISO changes its Prolog standard. :)

Bill

> Hi Bill,
> 
> > command.c: In function 'c_interp':
> > command.c:55: error: invalid lvalue in assignment
> 
> You have an invalid lvalue in your assignment on-or-near line 55.
> 
> > command.c: In function 'c_condition':
> > command.c:190: error: invalid lvalue in assignment
> > command.c:194: error: invalid lvalue in assignment
> 
> You have two more invalid lvalue in your assignments on-or-near lines 190
> and 194.
> 
> > command.c: In function 'c_doall':
> > command.c:215: warning: incompatible implicit declaration of
built-in function
> 'strlen'
> 
> It appears you forgot to #include <string.h> at the top of your command.c
> file.  Or your source re-declares strlen in an incompatible way.
> 
> HTH,
> --Eljay
> 
> 

________________________________________________________________
Please visit a saintly hero.
http://www.jakemoore.org

"Pro-choice?"  Click here:
http://www.abortionno.com/Resources/pictures.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Error messages I don't understand
@ 2007-05-09 16:12 Bill McEnaney
  0 siblings, 0 replies; 7+ messages in thread
From: Bill McEnaney @ 2007-05-09 16:12 UTC (permalink / raw)
  To: kf, gcc-help, Bill McEnaney

Aha!  The program is full of casts, and I was right when I thought I
needed to run an old version of gcc. But I wouldn't dare try to rewrite
the program. Thanks.

> Probably you have some legacy code that uses some casting tricks in
> the left-hand side of the operand... But lvalue casting was a gcc
> extension I think, and has been removed from the latest versions...
> I.e. the code probably was 'correct' w.r.t. gcc at some point in
> history, but never legal C... You have to use older gcc version, or
> rewrite your code.
> 
> > Bill
> >
> > Script started on Sat 28 Apr 2007 12:30:11 PM EDT
> > %cd source
> > %gmake
> > gcc  -O2    -c -o command.o command.c
> > command.c: In function 'c_interp':
> > command.c:55: error: invalid lvalue in assignment
> > command.c: In function 'c_condition':
> > command.c:190: error: invalid lvalue in assignment
> > command.c:194: error: invalid lvalue in assignment
> > command.c: In function 'c_doall':
> > command.c:215: warning: incompatible implicit declaration of built-in
> > function
> > 'strlen'
> > gmake: *** [command.o] Error 1
> > %^D\b\bexit
> >
> > script done on Sat 28 Apr 2007 12:30:35 PM EDT
> >
> >
> >
> >
> > ________________________________________________________________
> > Please visit a saintly hero.
> > http://www.jakemoore.org
> >
> > "Pro-choice?"  Click here:
> > http://www.abortionno.com/Resources/pictures.html
> >
> >
> 
> 

________________________________________________________________
Please visit a saintly hero.
http://www.jakemoore.org

"Pro-choice?"  Click here:
http://www.abortionno.com/Resources/pictures.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-05-09 19:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-09 15:19 Error messages I don't understand Bill McEnaney
2007-05-09 15:31 ` kf
2007-05-09 15:33 ` John Love-Jensen
2007-05-09 16:12 Bill McEnaney
2007-05-09 16:14 Bill McEnaney
2007-05-09 16:29 Bill McEnaney
2007-05-09 19:33 Bill McEnaney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).