Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

declaration of 'clone'

2 views
Skip to first unread message

Klaas-Jan Stol

unread,
Jan 12, 2006, 10:29:51 AM1/12/06
to perl6-i...@perl.org
Hi,

I'm trying to implement some functions into the Lua PMCs, but I'm having
trouble to compile them.

I want to add a clone method to the LuaNil PMC (which should extend
Null.pmc, not None.pmc, as it does currently; changed that already)

However, I get the following error:

luanil.c:343: error: conflicting types for `clone'
/usr/include/bits/sched.h:72: error: previous declaration of `clone'
compile luanil.c failed (256)
make: *** [pmcs] Error 2

It seems the compiler finds another function called "clone", which has
nothing to do with Parrot:

/* Definitions of constants and data structure for POSIX 1003.1b-1993
scheduling interface.
Copyright (C) 1996-1999,2001,2002,2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.

regards,
klaas-jan

Leopold Toetsch

unread,
Jan 12, 2006, 10:53:26 AM1/12/06
to Klaas-Jan Stol, perl6-i...@perl.org
Klaas-Jan Stol wrote:
> Hi,
>
> I'm trying to implement some functions into the Lua PMCs, but I'm having
> trouble to compile them.
>
> I want to add a clone method to the LuaNil PMC (which should extend
> Null.pmc, not None.pmc, as it does currently; changed that already)
>
> However, I get the following error:
>
> luanil.c:343: error: conflicting types for `clone'
> /usr/include/bits/sched.h:72: error: previous declaration of `clone'
> compile luanil.c failed (256)

clone is a standardized vtable function. But it's name is never a bare
'clone', it's always prefixed by 'Parrot_<ClassName>_. This is also true
for

METHOD PMC* clone() # dunno if that works, if vtable exists

You must have some bug in your PMC code.

leo

Joshua Hoblitt

unread,
Jan 12, 2006, 7:11:52 PM1/12/06
to Leopold Toetsch, Klaas-Jan Stol, perl6-i...@perl.org

On Linux clone() is a syscall with a wraper function in the the standard
library that is defined in sched.h. On my laptop types.h includes
pthreadtypes.h which includes sched.h. You should *probably* use a
different function name. ;)

-J

--

Klaas-Jan Stol

unread,
Jan 13, 2006, 4:55:39 AM1/13/06
to Joshua Hoblitt, Leopold Toetsch, perl6-i...@perl.org
Joshua Hoblitt wrote:

I got the bug already, thank! (stupid error in PMC file) Works perfectly
now.
-kj

0 new messages