9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Tolpin <dvd@davidashen.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] fp stack overflow -- hypot
Date: Fri,  5 Mar 2004 03:54:08 +0400	[thread overview]
Message-ID: <200403042354.i24Ns8tA073468@adat.davidashen.net> (raw)
In-Reply-To: <02bb01c40244$20a2ac20$8201a8c0@cc77109e>

> 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


  reply	other threads:[~2004-03-04 23:54 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-04 22:18 David Tolpin
2004-03-04 23:08 ` Bruce Ellis
2004-03-04 23:10   ` boyd, rounin
2004-03-04 23:53 ` Bruce Ellis
2004-03-04 23:54   ` David Tolpin [this message]
2004-03-05  6:32     ` Charles Forsyth
2004-03-06 10:24       ` Bruce Ellis
2004-03-05 12:13 Trickey, Howard W (Howard)
2004-03-05 12:19 ` boyd, rounin
2004-03-05 12:24 ` Gorka Guardiola Múzquiz
2004-03-05 12:30   ` boyd, rounin
2004-03-05 12:36     ` Gorka Guardiola Múzquiz
2004-03-05 12:38       ` Fco.J.Ballesteros
2004-03-05 12:49         ` boyd, rounin
2004-03-05 12:46       ` boyd, rounin
2004-03-05 12:24 ` David Tolpin
2004-03-05 12:37   ` boyd, rounin
2004-03-05 15:14 ` a
2004-03-05 15:25   ` boyd, rounin
2004-03-08 10:14     ` Douglas A. Gwyn
2004-03-08 10:59       ` Bruce Ellis
2004-03-09  9:47         ` Douglas A. Gwyn
2004-03-09 12:19           ` boyd, rounin
2004-03-09 22:58           ` Bruce Ellis
2004-03-11  9:38             ` Douglas A. Gwyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200403042354.i24Ns8tA073468@adat.davidashen.net \
    --to=dvd@davidashen.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).