To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 440
439  |  441
Subject: 
Having trouble with -D option
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Thu, 10 Feb 2000 23:13:43 GMT
Viewed: 
1712 times
  
If I compile this program (named d.nqc):
    /* nqc program */
    #if (D == 1)
    task main() {}
    #endif

with the command:
    nqc -DD=1 d.nqc

I get the following error:
    # Error: syntax error in expression
    File "d.nqc" ; line 2
    # #if (D == 1)
    #      ^
    #----------------------------------------------------------
    # 1 error during compilation

But change the program to this:
    /* nqc program */
    #define D 1
    #if (D == 1)
    task main() {}
    #endif

and it works fine ... what am I missing?

I'm using "nqc version 2.0.1 (built Oct  5 1999, 16:51:16)"
from the CD that came with the book.  Nice book, BTW.



Message has 2 Replies:
  Re: Having trouble with -D option
 
(...) Same with 2.1b3. FWIW, #ifdef D task main() {} #endif works as expected. D is getting defined, just not to 1. (Or to any number.) (25 years ago, 11-Feb-00, to lugnet.robotics.rcx.nqc)
  Re: Having trouble with -D option
 
You found a bug - NQC is actually defining D to be the tokens =1, which then leads to a lot of confusion later on. Basically I bungled the pointer math. I fixed the source so the next release (2.1 final) should be fine. I'll probably release 2.1 in (...) (25 years ago, 11-Feb-00, to lugnet.robotics.rcx.nqc)

7 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