Date: Sat, 15 Feb 1997 17:41:35 -0500 From: Joel Ray Holveck <joelh@gnu.ai.mit.edu> To: joerg_wunsch@uriah.heep.sax.de Cc: cmott@srv.net, freebsd-chat@FreeBSD.ORG Subject: Re: Trying to understand stack overflow Message-ID: <199702152241.RAA21313@kropotkin.gnu.ai.mit.edu> In-Reply-To: <Mutt.19970214232642.j@uriah.heep.sax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
>> Would there be any problems with code that assumes a pointer is the same >> size as a long int? >Probably not for the i386 architecture in ``flat'' mode. But you can >see the problem already quickly if you think of that dreaded segmented >mode (with its various memory models). I haven't seen much code that assumes sizeof(void*) == sizeof(long int), although I've seen quite a bit of code that assumes that sizeof(void*) == sizeof(int), or worse, that a void* and an int can be exchanged without lossage. (If the former is true, then the latter is fine so long as you don't start calculating array offsets or doing other pointer arithmetic.) >I think the C FAQ contains a panopticum of other weird architectures >where this assumption is invalid. It's generally considered bad style >to assume this. If I recall correctly, this is invalid on many 64-bit machines. -- http://www.wp.com/piquan --- Joel Ray Holveck --- joelh@gnu.ai.mit.edu All my opinions are my own, not the FSF's, my employer's, or my dog's. Second law of programming: Anything that can go wrong wi sendmail: segmentation violation -- core dumped
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702152241.RAA21313>
