Re: ecpg compile error on AIX

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: ecpg compile error on AIX
Date: 2002-01-07 21:07:40
Message-ID: 14463.1010437660@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)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. This is 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 2002-01-07 22:31:35 Re: RC1 time?
Previous Message Don Baccus 2002-01-07 19:52:27 Re: ON ERROR triggers