[mercury-users] SegV on ROTD2006-04-26.sun.sparc.solaris2.8 on pointer passing with cc

doug.auclair at logicaltypes.com doug.auclair at logicaltypes.com
Tue Jun 13 04:13:59 AEST 2006

Dear all,

I'd like to use mercury on the Sparc with the Solaris C compiler (project resources 
and requirements force this play).  I can get C functions that accept and return
primitive simple types (I've tried int), but when I, for example use the io library,
it SegV's with an unuseful stack dump (the stack frames are all simply memory
pointers with no file or line information), e.g., this following function:

:- pragma export(print_num(in, di, uo)).
:- pred print_num(int::in, io::di, io::uo) is det.
print_num(Int) --> write(Int).

breaks the C program calling it:

int main(int argc, char* argv[])

I followed the user-man's instructions to mercury_config for the Solaris C compiler
and statically linked in the mercury runtime, etc (i.e. I used the libmer_<foo>.a files).

Something I can do to fix this issue?  Again,

:- pragma export(summer(in, in) = out).
:- func summer(int, int) = int.
summer(A, B) = A + B.

plays nicely with the Solaris C executable that calls this Mercury function.

Doug Auclair

mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list