Go to Post Guys wearing pink, that strikes fear into my heart now :). - Cyberguy34000 [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 19-02-2006, 22:24
pbhead pbhead is offline
Registered User
FTC #1123
 
Join Date: Feb 2006
Location: below tin. next to bismuth.
Posts: 36
pbhead is just really nicepbhead is just really nicepbhead is just really nicepbhead is just really nicepbhead is just really nice
syntax error in code that i have never even seen before: HELP!

so... i was working with my code... and i try to compile it again... the same way i have for about 50 times now, when suddenly a syntax error apperes. no problem right? it is probley a missing semicolon or something, except it appered in some wacked section of the code i didnt even know EXisted! Me = CONFUSED!



tryied fixing it, but came up with nothing... tryied cutting and pasting from defalt code, still nothing....

HELP!

here is the magical code of doom(all of it, the entire page) ( i founded it in C:mcc18\h\stdarg.h):
Quote:
/* $Id: stdarg.h,v 1.2 2004/08/04 18:46:23 GrosbaJ Exp $*/

#ifndef __STDARG_H
#define __STDARG_H

(says syntax error on this line) typedef void* va_list;
#define va_start(ap,1) {(ap)=(void*)((char*)&(1));}
#define va_end(ap)
#define va_arg(ap,t) (*((t*)((ap)=((t*)ap)-1)))
#define va_copy(dst, src) ((dst) = (src))
#endif
help?

the dead line is in 2 days!! ack!!!!!!

and my code is having problems after it was working fine! (but wasnot done)

Last edited by pbhead : 19-02-2006 at 22:30.
  #2   Spotlight this post!  
Unread 19-02-2006, 23:52
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
Re: syntax error in code that i have never even seen before: HELP!

Our programmer had the same problem happen yesterday. It has nothing to do with the stdarg.h file. Never touch the include files in MCC18/h/. Always assume they work.

In our case the programmer was new to declaring variables in .h files and had a syntax problem. I showed him files which had the proper syntax, he made changes to his code then it worked fine.

If you have a known timeframe of when the last build worked look for all source files with a later date.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
  #3   Spotlight this post!  
Unread 20-02-2006, 01:36
steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: syntax error in code that i have never even seen before: HELP!

Well, don't always assume that the header files are correct... I was having huge headaches trying to compile a line of code to set the priority of interrupt 3 (INT3IP) to 0. Turned out that the header file had misspelled it as INT3P, even though the datasheet was quite clear that it was INT3IP... That blew a couple of my hours! :/
__________________
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!
  #4   Spotlight this post!  
Unread 20-02-2006, 08:33
pbhead pbhead is offline
Registered User
FTC #1123
 
Join Date: Feb 2006
Location: below tin. next to bismuth.
Posts: 36
pbhead is just really nicepbhead is just really nicepbhead is just really nicepbhead is just really nicepbhead is just really nice
Re: syntax error in code that i have never even seen before: HELP!

so.... are you saying that there is a problem somewhere else in my code(very likely) and the compiler desided to put the error message here?
  #5   Spotlight this post!  
Unread 20-02-2006, 10:04
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,833
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: syntax error in code that i have never even seen before: HELP!

Quote:
Originally Posted by pbhead
so.... are you saying that there is a problem somewhere else in my code(very likely) and the compiler desided to put the error message here?
Yes.
What probably happened is you introduced a syntax error, but you know how the compiler will sometimes highlight the line after an error? When it finally figures out you mistyped something? If your syntax error occurs right before an #include statement, it'll instead highlight the first line in that inoffensive include file (or one of the many nested system include files).

I've often seen it when someone accidentally hits the keyboard and unknowingly inserts a random character at the very top of one of their source files.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #6   Spotlight this post!  
Unread 20-02-2006, 10:26
pbhead pbhead is offline
Registered User
FTC #1123
 
Join Date: Feb 2006
Location: below tin. next to bismuth.
Posts: 36
pbhead is just really nicepbhead is just really nicepbhead is just really nicepbhead is just really nicepbhead is just really nice
Re: syntax error in code that i have never even seen before: HELP!

ROFL! the problem was a random "C" in front of a /*

me = feel stupid.........


thx!!!
  #7   Spotlight this post!  
Unread 20-02-2006, 12:47
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
Re: syntax error in code that i have never even seen before: HELP!

Quote:
Originally Posted by pbhead
the problem was a random "C" in front of a /*
Glad you found it. Our programmer had a similar problem. It is a common (easy) mistake caused by how the focus of the text cursor works. Make sure the text cursor is in view before any text key is pressed.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.

Last edited by Keith Watson : 20-02-2006 at 15:15.
  #8   Spotlight this post!  
Unread 20-02-2006, 14:37
aksimhal's Avatar
aksimhal aksimhal is offline
Registered User
AKA: Anish
FRC #1123 (Autodidactic Intelligent Minors)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Burke, VA
Posts: 180
aksimhal is an unknown quantity at this point
Send a message via AIM to aksimhal
Re: syntax error in code that i have never even seen before: HELP!

Great Job!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  #9   Spotlight this post!  
Unread 24-02-2006, 12:02
mallot1243's Avatar
mallot1243 mallot1243 is offline
Registered User
FRC #1243
 
Join Date: Apr 2004
Rookie Year: 2004
Location: Swartz Creek, MI
Posts: 27
mallot1243 is an unknown quantity at this point
Re: syntax error in code that i have never even seen before: HELP!

I'm having the same problem, however there is no random letters before comments and after the syntax error I commented out the last bit of code (just a Get_Analog_Value). It seems weird a typedef* va_list function would be the syntax though.
__________________


WINNER! 2004 West Michigan Regional
2004 Rookie All-Star Pittsburgh Regional
2004 Highest Rookie Seed Pittsburgh Regional
2004 Rookie Inspiration Award West Michigan Regional
2004 Highest Rookie Seed West Michigan Regional (3rd)
2004 #2 Seed Kettering Kick-Off
2004 Kettering Kick-Off "Big Dog" (Finalist)
2005 Qtr-Finalist Pittsburgh Regional
2005 Kettering Kick-Off Qtr-Finalist
2006 Midwest Qtr-Finalist
2006 Midwest 12th Seed
  #10   Spotlight this post!  
Unread 24-02-2006, 12:12
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,833
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: syntax error in code that i have never even seen before: HELP!

Well, based on what you posted you have a typo in one of your .c files right before an #include "stdio.h"

What file is being compiled when the syntax error is reported?
Post that file.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 24-02-2006 at 12:14.
  #11   Spotlight this post!  
Unread 24-02-2006, 14:22
Keith Watson Keith Watson is offline
Registered User
FRC #0957 (WATSON)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2006
Location: Wilsonville, OR
Posts: 112
Keith Watson is just really niceKeith Watson is just really niceKeith Watson is just really niceKeith Watson is just really nice
Re: syntax error in code that i have never even seen before: HELP!

Always remember that you are smarter than the compiler.

How is something like this tracked down? A problem with a standard h file is most likely caused by a syntax error before that file is included.

Look at what files in the FRC directory include stdarg.h. None. So it has to be included from a .h file somewhere. Look in MCC18/h. It is only included by stdio.h and is the first thing in that file.

So the place to look for errors is between the start of the .c file which is not compiling and the line "#include <stdio.h>".
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
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
Out of the Box Camera Code russell Programming 9 21-10-2009 05:28
Problem with idata_user_routines.o? Adrien Programming 3 12-02-2006 01:33
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28
Sourceforge for Code Repository and other stuff SilverStar Programming 9 15-01-2005 21:16
heres the code. y this not working omega Programming 16 31-03-2004 15:18


All times are GMT -5. The time now is 20:21.

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