|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||||
|
|||||
|
Routine declaration syntax error (Or: Where's wlado?)
Here's a stumper:Code:
char Autonomous_1 (char State) // <---Right Here!
{
//...
}
|
|
#2
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
That looks OK on cursory examination. What comes right before that line? Is it possible you have unmatched braces?
|
|
#3
|
||||
|
||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
a lot of times, it will give you a syntax error and the real error will be 10 lines up from the little green arrow.
|
|
#4
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
Quote:
Code:
#include "printf_lib.h" /******************************************************************************* * FUNCTION NAME: PrintRamString * PURPOSE: Run 1 loop for autonomous mode 1 * CALLED FROM: anywhere * ARGUMENTS: * Input: char State - What is the state of atuonomous * RETURNS: char - is it finished? *******************************************************************************/ |
|
#5
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
The only thing above it is comments and #includes
|
|
#6
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
Have you modified printf_lib.h?
|
|
#7
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
Quote:
|
|
#8
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
I added
Code:
/************************************************** *****************************
* FUNCTION NAME: PrintRamString
* PURPOSE: Run 1 loop for autonomous mode 1
* CALLED FROM: anywhere
* ARGUMENTS:
* Input: char State - What is the state of atuonomous
* RETURNS: char - is it finished?
************************************************** *****************************/
char Autonomous_1 (char State) // <---Right Here!
{
//...
}
|
|
#9
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
Code:
/******************************************************************************* * FILE NAME: printf_lib.h * * DESCRIPTION: * This is the include file which corresponds to printf_lib.c * * USAGE: * If you add your own routines to that file, this is a good place * to add function prototypes. *******************************************************************************/ #ifndef __printf_lib_h_ #define __printf_lib_h_ int printf(rom const char *format, ...); void printid(int data,int crtOn); void printb(unsigned char data,int crtOn); void printd(unsigned char data,int crtOn); void printix(int data,int crtOn); void printx(unsigned char data,int crtOn); void debug_print(char *bufr,int data); void debug_printb(char *bufr,unsigned int data); void debug_println(char *bufr); #endif /******************************************************************************/ /******************************************************************************/ /******************************************************************************/ |
|
#10
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
Well, you might be right. I'm still stumped. You didn't do something weird like #defining char, Autonomous_1 or State, did you? (Or parentheses or underscores, taking a lesson from those obfuscated C samples posted elsewhere?)
|
|
#11
|
||||
|
||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
I'm stumped too...
![]() |
|
#12
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
Since you have an #ifdef/#endif protecting your printf_lib.h from being included multiple times, I suspect the problem is being caused by the line(s) before that #include. Post a bit more context, and look at the other included files for unmatched parentheses or braces or even missing semicolons.
|
|
#13
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's waldo?)
After 3 of us working on 4 computers last night to get it to compile, we got it to compile. There were various similar problems throughout the new stuff. I have to ask: Is there a limit on the number af function prototypes in a file?
|
|
#14
|
|||||
|
|||||
|
Re: Routine declaration syntax error (Or: Where's waldo?)
Quote:
|
|
#15
|
|||
|
|||
|
Re: Routine declaration syntax error (Or: Where's wlado?)
Is there some reason why you can't use the stock printf lib if it works? If you can't, try remodifying it one change at a time to see what it is.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|