9front - general discussion about 9front
 help / color / mirror / Atom feed
From: 有澤健治 <karisawa@gmail.com>
To: 9front <9front@9front.org>
Subject: [9front] Bug in APE pcc
Date: Sun, 1 Oct 2023 10:52:17 +0900	[thread overview]
Message-ID: <CAN4cm2uyd=hZf2f+CiFYWr8_5E26qiZ5CG_3COADm5qOALLL9g@mail.gmail.com> (raw)

Try:
------ BEGIN ----
#include <stdio.h>
#include <math.h>
int
main(int argc, char *argv[])
{
    printf("log2 %f\n",log2(8));
    printf("log10 %f\n",log10(100));
    return 0;
}
----- END ----

The result is
hebe# pcc -o a1 a1.c
/usr/arisawa/doc/ape/intro/a1.c:7[stdin:321] function not declared: log2
hebe#
hebe# ape/psh
$ cc -o a1 a1.c
$ a1
log2 0.000000
log10 2.000000

How to fix the problem?
add
    extern double log2(double);
to
    /amd64/include/ape/math.h
then OK.

Kenji Arisawa

             reply	other threads:[~2023-10-01  1:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-01  1:52 有澤健治 [this message]
2023-10-01  2:32 ` Amavect
2023-10-01 11:53   ` 有澤健治

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='CAN4cm2uyd=hZf2f+CiFYWr8_5E26qiZ5CG_3COADm5qOALLL9g@mail.gmail.com' \
    --to=karisawa@gmail.com \
    --cc=9front@9front.org \
    /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).