|
From: Lars C. <la...@cs...> - 2001-06-05 17:33:37
|
Description: This patch fixes cast alignment bugs detected by using the -Wcast-align option for gcc. Although *((DWORD*)&buffer[5]) = value; may work on an intel processor, it is not portable because some architechtures (e.g. sparc) cannot copy DWORDS if they are not aligned on a multiple of 4 bytes. The attached patch fixes all occurences of such statements to: memcpy(buffer + 5, &value, sizeof(DWORD)); The patches is tested and icqlib works on Sparc Solaris with is (UDP communication at least. TCP code is also changed, but untested - it does compile though). icqlib would about with a "bus error" or "segmentation fault" without this patch. -- Lars Christensen, la...@cs... |