To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1787
1786  |  1788
Subject: 
Re: Linking failure when 'making' an lx file
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sun, 25 Mar 2001 13:06:22 GMT
Viewed: 
1466 times
  
if(unsigned_long_var1 - unsigned_long_var2) > sizeof(unsigned char)) .....

Syntax error: you are missing a parenthesis at the start, right after the
if.  But gcc should give a fat error at the ">" sign I believe.

if( COND ) STATEMENT;

if( (ul_var1 - ul_var2) > sizeof(uchar)) STATEMENT;

By evaluating both sides of the '>' seperatly and assigning the results to
variables, before testing the '>' between these two variables, the problem
miraculously disappeared .....strange I know ...

Does this mean that the compiler is failing whilst trying to optimise the
code ? I'm still very new to C/C++ so I'd appreciate any information or
possible explanation of this .....still learning ;-)

It is miraculous that the first code version worked.  Are using -Wall to
gcc, to give all possible warnings?

Try the code in another compiler and see how they complain.  In general,
trying both visual C++ and gcc on the same code gives a good set of errors
and warnings.  Using just one has a tendency to let big bugs slip through.
And remeber to turn off all "language extensions" if you want good error
handling.

/jakob



Message is in Reply To:
  Re: Linking failure when 'making' an lx file
 
(...) Sorry about the extra stuff, the linking problem was due to the compiler trying to find the above link "___ucmpsi2". When I used h8300-hitachi-hms-nm I could see all the methods and links in my code, and this was the only strange looking one. (...) (24 years ago, 28-Aug-00, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR