Using pragma in .c and .h file

76 Views Asked by At

I am using pragma like this in .c file:

#pragma ghs startdata
#pragma ghs section bss=".BSS"
static int A;
#pragma ghs section bss=default
#pragma ghs enddata

in .h file:

extern int A;

When i build with Greenhill compiler, it shows this waring: incompatibility associated with redeclaration of variable "A": data type differs from earlier declaration's unspecified type

When i added 2 lines in .h file:

#pragma ghs startdata
extern int A;
#pragma ghs enddata

Above warning was gone.

So, anyone can explain to me why is that? warning was gone when i added 2 line above in header file

0

There are 0 best solutions below