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