From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Tolpin Message-Id: <200403042354.i24Ns8tA073468@adat.davidashen.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] fp stack overflow -- hypot In-Reply-To: <02bb01c40244$20a2ac20$8201a8c0@cc77109e> Content-Type: text/plain; charset=KOI8-R Date: Fri, 5 Mar 2004 03:54:08 +0400 Topicbox-Message-UUID: 15cf9a28-eacd-11e9-9e20-41e7f4b1d025 > ok, i've found the problem. take a look in: > > /386/include/ape/math.h > > and you'll see that hypot() is not declared unless > > _RESEARCH_SOURCE is. > > hence the compiler presumes that the function returns > int and picks up AX rather than popping the fp stack. > > solution: either define _RESEARCH_SOURCE, or if > that introduces conflicts then simply copy the prototype > from math.h to somewhere visible. > > it may really be a "faulty", in the posix sense, math.h > but i'm avoiding investigating that. Yes, you are right, I am wrong, I wrote about it to the list; my apologies. hypot is not POSIX. I just didn't realize that, unlike pcc, cc does not issue warnings by default. David