>> Btw., I've never seen any problems related to -Wcast-align? Is the TODO
>> item obsolete or is it platform-related?
Youse guys that run on Intel hardware will never see any problems from
it, except possibly a lost cycle here or there due to unaligned fetches.
But a lot of non-Intel hardware (particularly RISC architectures) treats
an unaligned access as a segfault.
Right at the moment we can't usefully enable -Wcast-align because it
generates an unreasonable number of complaints. Someday I'm going to
try to clean those all up. My personal todo list has:
Reduce, or eliminate entirely, warnings issued by -Wcast-align. gcc will
warn about char* to foo* but not about void* to foo*, so the bulk of the
warnings might be controllable by using void* in places where we now use
char*. Be careful not to introduce arithmetic on void* pointers though;
use -Wpointer-arith to catch those. Ideally we should add both of these
(and maybe some other non-Wall flags) to standard gcc arguments.
regards, tom lane