Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   stdarg.h Syntax error (http://www.chiefdelphi.com/forums/showthread.php?t=52603)

bronxbomber92 23-01-2007 20:24

stdarg.h Syntax error
 
Hello,

This is my first time posting here, and first year compteting! I'm excited to be here, and thought that was worth mentioning :)

My problem, as that out of the blue my compiler gives me the error
Code:

Stdarg.h:6: Syntax Error
The line is
Code:

typedef void* va_list;
I have no idea why this occured, as about a hour earlier it compiled fine, and the only change I had made to it was adding a printf() statement. I tried deleting that afterward in hope that was the problem (though it shouldn't be anyways), but no go. The error was still apparent.

Has anyone encountered this before, or have any solutions?

Thanks a bunch,
Jedd

Orborde 23-01-2007 20:33

Re: stdarg.h Syntax error
 
I have a hunch that you messed something up near the beginning of the file, and the stdarg.h error is simply the compiler complaining as a result of something in your file. For example:

Code:

int foo = 6 // no semicolon!
#include <stdio.h>

will tend to give you an error in stdio.h, even though the problem is in the original file. Take a look at the top of your file for syntax errors.

bronxbomber92 24-01-2007 15:50

Re: stdarg.h Syntax error
 
All right, thanks. I don't think that is the problem as I've only added one function and the printf() function to all the code, and the function I made worked properly the day before... I'll check again. Anyne by chance know what file stdarg.h is included in?

Mark McLeod 24-01-2007 16:17

Re: stdarg.h Syntax error
 
stdarg.h is included by stdio.h

It is simply the first true line of code the compiler encounters when #include <stdio.h> is used and it can recognize that an error has occurred. The error won't be in the system files, but in .c files you have touched.

Usually I've seen this when random characters are accidentally typed on the very first line of a .c file.
Take a look to see if anything has been typed BEFORE the
/******************
on the very top line of the .c files you've been modifying.

bronxbomber92 24-01-2007 16:27

Re: stdarg.h Syntax error
 
Quote:

Originally Posted by Mark McLeod (Post 564308)
stdarg.h is included by stdio.h

It is simply the first true line of code the compiler encounters when #include <stdio.h> is used and it can recognize that an error has occurred. The error won't be in the system files, but in .c files you have touched.

Usually I've seen this when random characters are accidentally typed on the very first line of a .c file.
Take a look to see if anything has been typed BEFORE the
/******************
on the very top line of the .c files you've been modifying.

That was it! Thanks... I didn't find in the files I had been in, so I went through the others, and behold, there was a random "v" as the first character of the file.

Thanks a bunch for your help!
Jedd


All times are GMT -5. The time now is 04:14.

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