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

From Tom Lane
Subject Re: ecpg compile error on AIX
Date
Msg-id 19040.1010451436@sss.pgh.pa.us
Whole thread Raw
In response to Re: ecpg compile error on AIX  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> I should have said, I've never seen any warnings generated by
> -Wcast-align.

Interesting.  On HP-PA with gcc 2.95.3 I see a ton of them.  I'm too
lazy to count 'em, but it's certainly in the thousands, eg from the
first backend module to be compiled I get

make[4]: Entering directory `/home/postgres/pgsql/src/backend/access/common'
gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -g -Wcast-align -I../../../../src/include   -c -o heaptuple.o
heaptuple.c
heaptuple.c: In function `ComputeDataSize':
heaptuple.c:52: warning: cast increases required alignment of target type
heaptuple.c: In function `DataFill':
heaptuple.c:113: warning: cast increases required alignment of target type
heaptuple.c:113: warning: cast increases required alignment of target type
heaptuple.c:123: warning: cast increases required alignment of target type
heaptuple.c:134: warning: cast increases required alignment of target type
heaptuple.c: In function `nocachegetattr':
heaptuple.c:299: warning: cast increases required alignment of target type
heaptuple.c:299: warning: cast increases required alignment of target type
heaptuple.c:357: warning: cast increases required alignment of target type
heaptuple.c:360: warning: cast increases required alignment of target type
heaptuple.c:360: warning: cast increases required alignment of target type
heaptuple.c:400: warning: cast increases required alignment of target type
heaptuple.c:408: warning: cast increases required alignment of target type
heaptuple.c:408: warning: cast increases required alignment of target type
heaptuple.c: In function `heap_copytuple':
heaptuple.c:486: warning: cast increases required alignment of target type
heaptuple.c: In function `heap_formtuple':
heaptuple.c:608: warning: cast increases required alignment of target type
heaptuple.c:610: warning: cast increases required alignment of target type
heaptuple.c:610: warning: cast increases required alignment of target type
heaptuple.c: In function `heap_modifytuple':
heaptuple.c:680: warning: cast increases required alignment of target type
heaptuple.c:680: warning: cast increases required alignment of target type
heaptuple.c: In function `heap_addheader':
heaptuple.c:765: warning: cast increases required alignment of target type
heaptuple.c:767: warning: cast increases required alignment of target type
heaptuple.c:767: warning: cast increases required alignment of target type


Needless to say I'd be pretty much unable to spot any real warnings
if we were to turn this on by default today.

> Shouldn't the set of warnings at least be the same on all
> platforms (at least those with the same integer size) or does it just warn
> if there would actually be a problem on that platform?

Apparently the latter.  Curious; you'd think the former would be more
useful.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ecpg compile error on AIX
Next
From: Sean Chittenden
Date:
Subject: Re: again on index usage