Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Cparser not detecting a typedef

I would look into reasons why it is not recognized in your case.

-sergey


On Mon, Feb 3, 2014 at 9:51 AM, Vishal Gupta <vishal.vit@xxxxxxxxx> wrote:
yes that's correct . Its definition can be found in win32.h file





On Mon, Feb 3, 2014 at 11:04 PM, Sergey Prigogin <eclipse.sprigogin@xxxxxxxxx> wrote:
What is DllExport? Is it a macro defined as __declspec(dllexport)?

-sergey


On Mon, Feb 3, 2014 at 8:50 AM, Vishal Gupta <vishal.vit@xxxxxxxxx> wrote:
Hello All,

I am facing a problem where CDT C Parser is detecting a typedef as a C variable and due to which in other .c files the Typedef is marked in error.

I have created a sample project to show the problem

Here are the project  files and their contents :

wince.c   (this is a code from perl module)
-------------------------------------------------------------------------------------------------

DllExport size_t
win32_fread(void *buf, size_t size, size_t count, FILE *fp)
{
  return fread(buf, size, count, fp);
}
   
-------------------------------------------------------------------------------------------------

types.h
-------------------------------------------------------------------------------------------------
typedef unsigned int  __uint32_t;

typedef __uint32_t size_t;
----------------------------------------------------------------------------------------------------

App.c

-----------------------------------------------------------------------------------------------
#include <types.h>

 size_t test_func(void){

}
-------------------------------------------------------------------------------------------------

Now the problem is that the "DLLExport" is not resolved, due to which size_t (the return type of function win32_fread),  is considered as a c variable . Even though it is defined as typedef in file types.h.

Due to this in my App.c the "size_t" is not getting resolved.

I had a real tough time to identify this problem in my actual code base. 

Is it a expected behavior of C Parser ?

For Reference i have attached the sample project. 

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top