* [9front] Bug in APE pcc
@ 2023-10-01 1:52 有澤健治
2023-10-01 2:32 ` Amavect
0 siblings, 1 reply; 3+ messages in thread
From: 有澤健治 @ 2023-10-01 1:52 UTC (permalink / raw)
To: 9front
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9front] Bug in APE pcc
2023-10-01 1:52 [9front] Bug in APE pcc 有澤健治
@ 2023-10-01 2:32 ` Amavect
2023-10-01 11:53 ` 有澤健治
0 siblings, 1 reply; 3+ messages in thread
From: Amavect @ 2023-10-01 2:32 UTC (permalink / raw)
To: 9front
On Sat, Sep 30, 2023 at 8:56 PM 有澤健治 <karisawa@gmail.com> wrote:
> How to fix the problem?
> add
> extern double log2(double);
> to
> /amd64/include/ape/math.h
This should already be in /sys/include/ape/math.h
However, /amd64/include/ape/*.h gets read first, making a conflict.
/amd64/include/ape/math.h should not exist.
Make sure /sys/include/ape/math.h exists (and contains log2),
then delete /amd64/include/ape/math.h
Thanks,
Amavect
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [9front] Bug in APE pcc
2023-10-01 2:32 ` Amavect
@ 2023-10-01 11:53 ` 有澤健治
0 siblings, 0 replies; 3+ messages in thread
From: 有澤健治 @ 2023-10-01 11:53 UTC (permalink / raw)
To: 9front
I'v tried.
Thanks Amavect.
Kenji Arisawa
2023年10月1日(日) 11:50 Amavect <amavect@gmail.com>:
>
> On Sat, Sep 30, 2023 at 8:56 PM 有澤健治 <karisawa@gmail.com> wrote:
> > How to fix the problem?
> > add
> > extern double log2(double);
> > to
> > /amd64/include/ape/math.h
> This should already be in /sys/include/ape/math.h
> However, /amd64/include/ape/*.h gets read first, making a conflict.
> /amd64/include/ape/math.h should not exist.
>
> Make sure /sys/include/ape/math.h exists (and contains log2),
> then delete /amd64/include/ape/math.h
>
> Thanks,
> Amavect
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-01 11:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-01 1:52 [9front] Bug in APE pcc 有澤健治
2023-10-01 2:32 ` Amavect
2023-10-01 11:53 ` 有澤健治
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).