C
Chris Peters
Hi,
I'm using some Fortran 77 code together with C, and the compiler is giving
me some strange warnings. Can anyone help explain what's going on? The
code runs just fine.
1)
Fortran code
integer m_testa(10)
common /testa/m_testa
C code
extern struct testa
{
int m_testa[10];
};
gives warning useless keyword or type name in empty declaration
==
2)
Fortran code
integer*8 m_addr (20)
common /testb/ m_addr
C code
extern struct testb
{
long long int m_addr[20]; // to contain any variable address
};
....
int value; // in the line below, my_addr is the address of an integer
variable
value = *(int*)testb_.m_addr[1];
gives warning cast to pointer from integer of different size
If I change the code to
long long int value;
value = *(long long int*)testb_.m_addr[1];
I still get the same warning.
Cheers,
Chris Peters
I'm using some Fortran 77 code together with C, and the compiler is giving
me some strange warnings. Can anyone help explain what's going on? The
code runs just fine.
1)
Fortran code
integer m_testa(10)
common /testa/m_testa
C code
extern struct testa
{
int m_testa[10];
};
gives warning useless keyword or type name in empty declaration
==
2)
Fortran code
integer*8 m_addr (20)
common /testb/ m_addr
C code
extern struct testb
{
long long int m_addr[20]; // to contain any variable address
};
....
int value; // in the line below, my_addr is the address of an integer
variable
value = *(int*)testb_.m_addr[1];
gives warning cast to pointer from integer of different size
If I change the code to
long long int value;
value = *(long long int*)testb_.m_addr[1];
I still get the same warning.
Cheers,
Chris Peters