Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!pilchuck!dataio!fnx!nazgul!bright From: bright@nazgul.UUCP (Walter Bright) Newsgroups: comp.lang.c Subject: Re: What breaks? (was Re: 64 bit longs?) Message-ID: <230@nazgul.UUCP> Date: 19 Jan 91 07:22:19 GMT References: <2567@casbah.acns.nwu.edu> <1991Jan13.220958.16568@zoo.toronto.edu> <54379@eerie.acsu.Buffalo.EDU> Reply-To: bright@nazgul.UUCP (Walter Bright) Organization: Zortech, Seattle Lines: 20 In article <54379@eerie.acsu.Buffalo.EDU> chu@acsu.buffalo.edu (john c chu) writes: /In article <1991Jan13.220958.16568@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: />It is intuitively appealing, but I would be surprised to see anyone />implementing it: it would break far too much badly-written software. /Can someone please tell me what would break under that model and why? /It's not that I don't believe it, or that I want to write code that /will break. It's that I want to avoid making the unwarranted /assumptions that would lead to my code breaking. Code that will break: char *p; unsigned long x; ... /* Read 4 bytes out of buffer */ x = *(unsigned long*)p; /* assume bytes are in correct order */ Also: x >>= 24; /* Now assume that x < 256 */ Also: x &= 0xFFFFFFFE; /* clear bit 0 */