Date: Tue, 25 Nov 2003 08:08:24 +0000 From: Mark Murray <mark@grondar.org> To: David Schultz <das@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: Size-independent byte order swapping functions. Message-ID: <200311250808.hAP88ODw039675@grimreaper.grondar.org> In-Reply-To: Your message of "Mon, 24 Nov 2003 17:13:08 PST." <20031125011308.GA98148@VARK.homeunix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
David Schultz writes: > > I'm not sure if dedicated epanic() is the best way to implement out-of-rang > e > > errors prevention - the more handy solution should cause compile error. > > See CTASSERT. There is an extremely limited number of sizes that are possible here, even with weird/theoretical architectures like 256-bit machines. Doesn't it make sense just to presume that out-of-range is impossible, and recode for default "if (sizeof(x) == 1) return x;" (ignore syntax) ? M -- Mark Murray iumop ap!sdn w,I idlaH
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311250808.hAP88ODw039675>