Strange compiler warnings

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
 
R

Ron Ford

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.

Fortran 77 is what John Travolta may have encountered were he not on the
disco floor. To combine that with the difficulties attending to long long
is the equivalent of asking his Italian friends to program. Let me take a
couple stabs at what the warnings may have been:

1) warning 5212: polyester is too hot in the long, long summertime.

2) warning 3414: has Microsoft even been founded yet?

3 warning 2784: you can take disco classes, but you were three left feet
with Susan tonight.

Update your capabilities with your common C extension:
http://www.silverfrost.com/11/ftn95/overview.asp

Zivjeli,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top