ecpg compile error on AIX - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject ecpg compile error on AIX
Date
Msg-id 20020107142743S.t-ishii@sra.co.jp
Whole thread Raw
Responses Re: ecpg compile error on AIX  (Michael Meskes <meskes@postgresql.org>)
Re: ecpg compile error on AIX  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I got followings with current on AIX 5L using xlc (native AIX
compiler):

:
:
:
"data.c", line 357.81: 1506-068 (S) Operation between types "void*" and "long" is not allowed.
"data.c", line 362.90: 1506-068 (S) Operation between types "void*" and "long" is not allowed.

Here is the portion the code:
    *((long long int *) (ind + ind_offset*act_tuple)) = variable->len;

Actually the compiler complains about "ind + ind_offset*act_tuple", 
where :
     void *ind;     long ind_offset;     int act_tuple;

So the code tries to add a long value to a void *pointer, which is not
correct since the storage unit size is unknown for void * I think. If
the code try to do a pointer calculation, "ind" should be casted to an
appropreate type such as char * or long * etc, depending on the logic
of the code.
--
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Further info on LWLock behavior
Next
From: Marko Kreen
Date:
Subject: Re: pgcryto strangeness...