Bug#85468: [PR target/9082] [alpha] memcpy makes unaligned access
Hi,
looking at the preprocessed source clearly reveals that this is not a
gcc bug:
union {
struct id_ts {
n_time its_otime;
n_time its_rtime;
n_time its_ttime;
} id_ts;
struct id_ip {
struct ip idi_ip;
} id_ip;
u_long id_mask;
char id_data[1];
} icmp_dun;
[...]
icp = ( struct icmp* )( buffer + hlen );
[...]
memcpy( &sent_time, icp->icmp_dun.id_data + ((size_t) &((PING_DATA *)0)->ping_ts), sizeof( sent_time ) );
memcpy( &this_count, icp->icmp_dun.id_data, sizeof( this_count ) );
id_data is 8-byte aligned. offsetof ping_ts is 8. So gcc rightfully
concludes the source is 8-byte aligned. Aparently, the cast from
buffer + hlen is bad.
Please reassign this bug to fping.
--
Falk
Reply to: