From: invalid AT erehwon DOT invalid (Graaagh the Mighty) Newsgroups: comp.os.msdos.djgpp,comp.lang.c++,comp.lang.c Subject: Re: DJGPP reserves wrong int size Organization: Low Charisma Anonymous Message-ID: <3b37e7cc.288391695@news.primus.ca> References: <9dde68b7 DOT 0106241053 DOT 2a385311 AT posting DOT google DOT com> X-Newsreader: Forte Free Agent 1.11/32.235 Lines: 35 Date: Tue, 26 Jun 2001 01:42:23 GMT NNTP-Posting-Host: 207.176.153.91 X-Complaints-To: news AT primus DOT ca X-Trace: news1.tor.primus.ca 993521986 207.176.153.91 (Mon, 25 Jun 2001 22:19:46 EDT) NNTP-Posting-Date: Mon, 25 Jun 2001 22:19:46 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Sun, 24 Jun 2001 19:48:48 GMT, kaz AT ashi DOT footprints DOT net (Kaz Kylheku) sat on a tribble, which squeaked: >it appears to reserves 0x18 bytes, which is 24. Must be another 20 bytes for some other data structure in there. Return address and the argc value, argv pointer, and env pointer could be 12 of those, unless the caller reserves those... >Note that you are asking questions about compiler implementation internals that >are off topic in comp.lang.c. I fail to see how that is relevant in comp.os.msdos.djgpp. >You don't have any ``results''; results arise when you run the program. If a >correct program executes correctly, then you have good results. Semantic quibbling. Object code is a "result" of compiling. There are additional "results" from running the compiled code. He was clearly referring to the first of these. >Note that you compiled without any optimization at all. When I compile >your example using -O and -fomit-frame-pointer, the function >is translated to a single ret instruction. So as you can see, it's possible >for a C implementation to reserve *less* automatic storage than what appears >to be required by the abstract semantics, as well as more. It's discarding an unused value in this case, it seems. And it looks like the frame pointer is indeed buried in those extra 20 bytes somewhere. -- Bill Gates: "No computer will ever need more than 640K of RAM." -- 1980 "There's nobody getting rich writing software that I know of." -- 1980 "This antitrust thing will blow over." -- 1998 Combine neo, an underscore, and one thousand sixty-one to make my hotmail addy.