Re: ecpg compile error on AIX - Mailing list pgsql-hackers

From Tom Lane
Subject Re: ecpg compile error on AIX
Date
Msg-id 14463.1010437660@sss.pgh.pa.us
Whole thread Raw
In response to ecpg compile error on AIX  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Responses Re: ecpg compile error on AIX  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: ecpg compile error on AIX  (Michael Meskes <meskes@postgresql.org>)
List pgsql-hackers
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> 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.

With HP's compiler I get lots of

cc: "data.c", line 57: error 1539: Cannot do arithmetic with pointers to objects of unknown size.

which is perhaps more to the point.  The GCC manual explains why Michael
was able to get away with this (I assume he used gcc):
  In GNU C, addition and subtraction operations are supported on  pointers to `void' and on pointers to functions.
Thisis done by  treating the size of a `void' or of a function as 1.
 
  A consequence of this is that `sizeof' is also allowed on `void' and  on function types, and returns 1.
  The option `-Wpointer-arith' requests a warning if these extensions  are used.

It occurs to me that we ought to add -Wpointer-arith to our standard
gcc options, so that this sort of mistake will be caught sooner in
future.

I consider this compile failure a "must fix" before we can go to RC1 ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Don Baccus
Date:
Subject: Re: ON ERROR triggers
Next
From: Thomas Lockhart
Date:
Subject: Re: RC1 time?