Jump to content
Sign in to follow this  
jess

preprocessor issues?

Recommended Posts

I just downloaded the latest version 4.6 and found it came up with a number of complie errors that the previous version didn't.  As far as i can tell it is having problems with #define (no all just some, seemingly random, but consistant).  I replace the define with a constant and it seems to be happy.  Has anyone else found this?

Share this post


Link to post
Share on other sites
Guest Pavel

I suspect you have these errors because the defines in your code are followed by comments on the same line. You need to move every such comment to another line:

 

Instead of:

#define K1   10 //My define

use:

//My define
#define K1   10

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

I'm just trying out the new compiler -- here is the output.

Compiling...

C2C-plus 4.6.3e C-compiler  Copyright© 1998-99,2000-2003 by Pavel Baranov

http://www.picant.com/c2c/c.html

support@picant.com

(Extended version)

Licensed to: Donald Erickson

TIMER16.C

line  324: Unknown symbol '.'

line   96: General error

line  106: General error in function definition

Finished.

Failed

 

I had always found that the first error listed was the crucial one -- in this case the period that it objects to is in a comment:

 

   /* if Sonalert on and secs = 0,

         1. turn on relay

         2. turn off interrupts

         3. wait for reset button   */

 

I have no idea where to go with this one.  Is the preprocessor trying to include my comments in the code?

Share this post


Link to post
Share on other sites
Guest Pavel
I'm just trying out the new compiler -- here is the output.

Compiling...

C2C-plus 4.6.3e C-compiler  Copyright© 1998-99,2000-2003 by Pavel Baranov

http://www.picant.com/c2c/c.html

support@picant.com

(Extended version)

Licensed to: Donald Erickson

TIMER16.C

line  324: Unknown symbol '.'

line 96: General error

line  106: General error in function definition

Finished.

Failed

 

I had always found that the first error listed was the crucial one -- in this case the period that it objects to is in a comment:

 

    /* if Sonalert on and secs = 0,

          1. turn on relay

          2. turn off interrupts

          3. wait for reset button */

 

I have no idea where to go with this one.  Is the preprocessor trying to include my comments in the code?

I can't reproduce this problem as you describe it. I inserted the same comment block into two C files and both compile without problems. There must be something else there (maybe nested comments?). Please check again.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Guest Pavel

A preprocessor fix that will handle comments after defines will be posted on the compiler download site shortly.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...