callback return nagetive address

Q&A's, tips, howto's

callback return nagetive address

Postby dexter » Sun Aug 30, 2015 5:53 pm

I am running newlisp on raspberry pi
Code: Select all
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 2.00
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 0010
Serial          : 0000000076c41fce



try to write some codes with callback so that I can use newlisp function in C

but callback gave me nagetive address when I try to do it like this:
Code: Select all
> (define (cmp a b) (- (get-int a) (get-int b)))
(lambda (a b) (- (get-int a) (get-int b)))
> (set 'func (callback 'cmp "int" "void*" "void*"))
-1225445368
>


because the address is nagetive so I got segment fault everytime exectued

but this code works well on x86 ,so is this a bug or what?

my newlisp is 10.6.2

thanks
dexter
 
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 2 guests

cron