Go to Post Honestly, no one at a FIRST competition is gonna judge you. Chances are, there are least 20 people dorkier than you. - JohnnyB [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 31-01-2006, 17:34
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
C18 v2.4 -- Syntax error where there is no syntax error

This is really weird! When I try to compile some code, I get a syntax error where there is no error at all! Like, in the header file for serial_ports.h (Kevin's code), the compiler dies here,

// if needed, declare functions and global variables that
// are specific to serial port one receiver functionality
#ifdef ENABLE_SERIAL_PORT_ONE_RX
--> void Init_Serial_Port_One(void);

So I start removing files (carefully), and at each compile it craps out at some (seemingly) random point in a header file.

Anyone experienced this?

Anyone have an idea as to what is wrong here?

At first I thought I had to switch to the large code model (>64KB), but that didn't help anything.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #2   Spotlight this post!  
Unread 31-01-2006, 17:39
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: C18 v2.4 -- Syntax error where there is no syntax error

I had the same problem last year. I think it can be resolved by simply checking the #include statements in all of your source files to be sure functions that are being referenced are included, and non used headers are not included. I know it seems kind of obvious, but give it a try.
  #3   Spotlight this post!  
Unread 01-02-2006, 16:50
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: C18 v2.4 -- Syntax error where there is no syntax error

Quote:
Originally Posted by Tom Bottiglieri
I had the same problem last year. I think it can be resolved by simply checking the #include statements in all of your source files to be sure functions that are being referenced are included, and non used headers are not included. I know it seems kind of obvious, but give it a try.
That did the trick, for the most part.

Thanks.
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #4   Spotlight this post!  
Unread 02-02-2006, 16:22
NASAbound1636 NASAbound1636 is offline
clueless???
AKA: joe
FRC #1636 (Reds Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: colorado
Posts: 20
NASAbound1636 is an unknown quantity at this point
Re: C18 v2.4 -- Syntax error where there is no syntax error

I had this same problem dogging me not 2 hours ago, look at your brackets in that file, not just what you edited but the WHOLE file. hope this helps!
__________________
there are 3 kinds of people in the world. those who can count, and those who can't.
Did you know that 4/3 of all people have trouble with fractions?
there are 10 kinds of people in the world, those who understand binary, and those who don't.
If you have 1 of these and you will let me use it then pm it to me
  #5   Spotlight this post!  
Unread 11-01-2007, 23:10
JayZ's Avatar
JayZ JayZ is offline
Registered User
FRC #0079 (Captain Krunch)
Team Role: Programmer
 
Join Date: May 2006
Rookie Year: 2006
Location: Clearwater, FL
Posts: 13
JayZ is on a distinguished road
Re: C18 v2.4 -- Syntax error where there is no syntax error

I've been having the same problem. The error comes up when it is compiling user_routines.c so I looked through the entire file for any missing semicolons or brackets. I didn't find anything wrong in it. I think the compiler may just be giving me the wrong location of the error so I guess I'll have to look throught the whole code. Until then any suggestions will be greatly appreciated.
  #6   Spotlight this post!  
Unread 12-01-2007, 01:11
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: C18 v2.4 -- Syntax error where there is no syntax error

One trick you can try is adding:

#ifdef NEVER
:
.
#endif

around chunks of your code and recompile. When I'm totally lost on how to isolate the issue this allows me to remove chunks of code from being compiled. If the problem still exists, I add the above to still more code.


Bud
  #7   Spotlight this post!  
Unread 12-01-2007, 09:31
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,818
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: C18 v2.4 -- Syntax error where there is no syntax error

This is a pretty common problem particular to include files.

The important clue is that the error gets flagged on the first line of some include file when the compiler finally figures out that you haven't closed a bracket somewhere previous.
The key is to remember that all your #include's are just inserting all that text into a single massive file that's then passed to the compiler, so the error is really getting flagged in the middle of that big file, not in the single include file spit out in the error message.

So thinking about it as one huge file rather than a series of includes...
What it really means is there is an error in another included file or other text before the include file that shows the error just like in regular code when it's often the line or block of code before.
If the error occurs in your very first include then the cause is often accidental characters typed at the very top of your source file or an unclosed comment field.

P.S.
Nice search skills by the way to rediscover this thread among thousands.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 12-01-2007 at 09:49.
  #8   Spotlight this post!  
Unread 12-01-2007, 17:27
JayZ's Avatar
JayZ JayZ is offline
Registered User
FRC #0079 (Captain Krunch)
Team Role: Programmer
 
Join Date: May 2006
Rookie Year: 2006
Location: Clearwater, FL
Posts: 13
JayZ is on a distinguished road
Re: C18 v2.4 -- Syntax error where there is no syntax error

I found the problem. In the very last line of the previous included file a semicolon was missing. I still don't know why the error only shows up on the first function prototype after it occurs instead of the next line. But now that I fixed it it doesn't really matter. Thanks for the help!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C18 v2.4 compiler location b_mallerd Programming 1 14-12-2005 16:43
Syntax Error: externs, structs, and macros Astronouth7303 Programming 3 16-02-2005 15:39
syntax error using enum{} gnormhurst Programming 8 07-02-2005 14:25
Routine declaration syntax error (Or: Where's wlado?) Astronouth7303 Programming 15 24-03-2004 05:51


All times are GMT -5. The time now is 16:54.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi