CDT not recognizing IN and OUT keywords [message #1228842] |
Wed, 08 January 2014 02:21  |
Eclipse User |
|
|
|
I have a huge C project that contains more than 1000 files and when I open this project in Eclipse, I get lot of errors in the editor (Orange squiggly lines).
When I analyze these, they seem to be associated with the IN and OUT keyword. For Example: The following function declaration shows error.
MY_TYPE
func3 (
IN int *This,
IN char *a,
OUT char **b
);
MY_TYPE is a typedef for void.
Please let me know how do I resolve this problem.
Actually, I also see some strange behavior which I couldnt understand. When I include the header file containing the definition for MY_TYPE into that c file, then the errors are gone. Alternatively, the errors are gone even if I remove the IN and OUT keywords.
Can anyone please let me know the issue and resolution for this.
I have also attached a sample project simulating this problem.
My current development environment is Indigo and I've tried this issue with Kepler. Both provides the same behavior.
Thanks,
Priyadharshini
|
|
|
Re: CDT not recognizing IN and OUT keywords [message #1233566 is a reply to message #1228842] |
Sun, 19 January 2014 20:40  |
Eclipse User |
|
|
|
If you define a typedef in a header file and want to use this typedef. You have to include this header file
For example your sample.h:
#ifndef SAMPLE_H_
#define SAMPLE_H_
typedef void MY_TYPE;
#endif /* SAMPLE_H_ */
Now include this in your SampleSource1.c and every file where you use MY_TYPE
#include "subsrc/Sample.h"
MY_TYPE func1(int a, int b)
{
return;
}
SampleSource1.c should now compile.
You do not need include guard(s) in *.c files, as this files are never included
This are some basic's that you should know, if you are coding in c!
Maybe you do some tutorials first?
www.cprogramming.com/tutorial/c-tutorial.html
|
|
|
Powered by
FUDForum. Page generated in 0.02951 seconds