Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Routine declaration syntax error (Or: Where's wlado?) (http://www.chiefdelphi.com/forums/showthread.php?t=27058)

Astronouth7303 22-03-2004 20:04

Routine declaration syntax error (Or: Where's wlado?)
 
:confused: Here's a stumper:

Code:

char Autonomous_1 (char State) // <---Right Here!
{
//...
}

The error is a syntax error. It is the only error in the listing, and it is at that line. I have removed 1 or 2 routines, and still get it.

Greg Ross 22-03-2004 20:10

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?

fred 22-03-2004 20:12

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.

Astronouth7303 22-03-2004 20:12

Re: Routine declaration syntax error (Or: Where's wlado?)
 
Quote:

Originally Posted by gwross
That looks OK on cursory examination. What comes right before that line? Is it possible you have unmatched braces?

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?
*******************************************************************************/


Astronouth7303 22-03-2004 20:14

Re: Routine declaration syntax error (Or: Where's wlado?)
 
The only thing above it is comments and #includes

Greg Ross 22-03-2004 20:25

Re: Routine declaration syntax error (Or: Where's wlado?)
 
Have you modified printf_lib.h?

Astronouth7303 22-03-2004 20:33

Re: Routine declaration syntax error (Or: Where's wlado?)
 
Quote:

Originally Posted by gwross
Have you modified printf_lib.h?

Some. Mostly just a #endif at the end.

Greg Ross 22-03-2004 20:43

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!
{
//...
}

right after a #include of our stock printf_lib.h. No error. How about if you post your printf_lib.h?

Astronouth7303 22-03-2004 20:46

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

/******************************************************************************/
/******************************************************************************/
/******************************************************************************/

Commenting out the last few declares don't help.

Greg Ross 22-03-2004 21:07

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?)

Ryan M. 23-03-2004 06:00

Re: Routine declaration syntax error (Or: Where's wlado?)
 
I'm stumped too... :)

Alan Anderson 23-03-2004 11:30

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.

Astronouth7303 23-03-2004 11:46

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?

Greg Ross 23-03-2004 12:27

Re: Routine declaration syntax error (Or: Where's waldo?)
 
Quote:

Originally Posted by Astronouth7303
Is there a limit on the number af function prototypes in a file?

Possible. How many did you have?

steven114 23-03-2004 22:04

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.


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

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