One of the recent changes has broken:
cd dynclasses && make
Which did, in fact, work for all of one checkout for me. =-)
This is on a fresh checkout (not update), configure, make, cd dynclasses and...
oolong:~/research/parrot2/dynclasses coke$ make
perl build.pl generate foo subproxy tclobject tclstring tclint tclfloat tcllist tclarray match matchrange
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump foo.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump subproxy.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump tclobject.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump tclstring.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump tclint.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump tclfloat.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump tcllist.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump tclarray.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump match.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --dump matchrange.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c foo.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c subproxy.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c tclobject.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c tclstring.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c tclint.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c tclfloat.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c tcllist.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c tclarray.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c match.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --c matchrange.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --library tclgroup --c tclobject.pmc tclstring.pmc tclint.pmc tclfloat.pmc tcllist.pmc tclarray.pmc
perl /Users/coke/research/parrot2/classes/pmc2c2.pl --library match_group --c match.pmc matchrange.pmc
perl build.pl compile foo subproxy tclobject tclstring tclint tclfloat tcllist tclarray match matchrange
c++ -g -pipe -pipe -fno-common -no-cpp-precomp -I/usr/local/include -pipe -fno-common -Wno-long-double -g -Dan_Sugalski -Larry -Wall -Wstrict-prototypes -Wmissing-prototypes -Winline -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Waggregate-return -Winline -W -Wno-unused -Wsign-compare -Wformat-nonliteral -Wformat-security -Wpacked -Wdisabled-optimization -falign-functions=16 -Wno-shadow -DHAS_JIT -DPPC -DHAVE_COMPUTED_GOTO -L/usr/local/lib -flat_namespace -bundle -undefined suppress -o foo.bundle -I/Users/coke/research/parrot2/include -I/Users/coke/research/parrot2/classes foo.c
In file included from /Users/coke/research/parrot2/include/parrot/global_setup.h:18,
from /Users/coke/research/parrot2/include/parrot/parrot.h:232,
from foo.c:15:
/Users/coke/research/parrot2/include/parrot/interpreter.h:61: error: conflicting
types for `typedef struct Parrot_Interp*Parrot_Interp'
/Users/coke/research/parrot2/include/parrot/platform_interface.h:124: error: previous
declaration as `struct Parrot_Interp'
In file included from /Users/coke/research/parrot2/include/parrot/interpreter.h:75,
from /Users/coke/research/parrot2/include/parrot/global_setup.h:18,
from /Users/coke/research/parrot2/include/parrot/parrot.h:232,
from foo.c:15:
/Users/coke/research/parrot2/include/parrot/register.h:54: error: conflicting
types for `struct Parrot_Interp'
/Users/coke/research/parrot2/include/parrot/interpreter.h:61: error: previous
declaration as `typedef struct Parrot_Interp*Parrot_Interp'
In file included from /Users/coke/research/parrot2/include/parrot/parrot.h:273,
from foo.c:15:
/Users/coke/research/parrot2/include/parrot/global.h:16: error: parse error
before `STRING'
/Users/coke/research/parrot2/include/parrot/global.h:17: error: parse error
before `STRING'
/Users/coke/research/parrot2/include/parrot/global.h:19: error: parse error
before `STRING'
foo.pmc: In function `void Parrot_Foo_class_init(Parrot_Interp*, int, int)':
foo.pmc:278: error: cannot convert `Parrot_Interp*' to `Parrot_Interp*' for
argument `1' to `STRING* string_make(Parrot_Interp*, const void*, long
unsigned int, const char*, long unsigned int)'
foo.pmc:281: error: cannot convert `Parrot_Interp*' to `Parrot_Interp*' for
argument `1' to `STRING* string_make(Parrot_Interp*, const void*, long
unsigned int, const char*, long unsigned int)'
foo.pmc:284: error: cannot convert `Parrot_Interp*' to `Parrot_Interp*' for
argument `1' to `STRING* string_make(Parrot_Interp*, const void*, long
unsigned int, const char*, long unsigned int)'
foo.pmc:294: error: cannot convert `Parrot_Interp*' to `Interp*' for argument `
1' to `void Parrot_mmd_register_parents(Interp*, long int, const MMD_init*,
long int)'
foo.pmc: In function `PMC* Parrot_lib_foo_load(Parrot_Interp*)':
foo.pmc:331: error: cannot convert `Parrot_Interp*' to `Parrot_Interp*' for
argument `1' to `void Parrot_Foo_class_init(Parrot_Interp*, int, int)'
compile foo.c failed (256)
make: *** [all] Error 2
> typedef struct Parrot_Interp *Parrot_Interp;
>
> I'm not surprised that chokes a C++ compiler, but I don't know why a C
> compiler tolerates it either. Not sure why this is necessary--I wonder
Because structs and types are different namespaces in C. (But the same in C++)
Not all valid C programs are valid C++
Nicholas Clark
> At the same time, I'm not sure why we need this construct in a header:
> struct Parrot_Interp;
> typedef struct Parrot_Interp *Parrot_Interp;
We don't need it. There was some discussion a while a go. This typedef
should just be removed.
The C<struct Parrot_Interp> *is* typedefed to C<Interp> anyway. That's
enough.
But as changing that yields probably a huge patch, I'd prefer, if someone
with CI privs just does s/Parrot_Interp (\w)/Interp *$1/g or such.
Thanks,
and
Thanks, applied.
leo
The embedding interface needs the typedef, but it doesn't need it to
have the same name as the struct. The struct is the odd man out
here--the standard used elsewhere in Parrot is:
Struct: struct parrot_whatever_t {...};
Internal typedef: typedef struct parrot_whatever_t Whatever;
External typedef: typedef struct parrot_whatever_t *Parrot_Whatever;
See the String/Parrot_String/parrot_string_t triplet for another
example of this.
I've written a patch to implement this change:
<http://www.brentdax.com/tmp/parrot.interp.patch>
Patch is 1979 lines, or ~81kb, and implements the scheme above.
Amusingly, Parrot is about 172kb smaller with this patch applied--all
those function declarations, I guess. I've reordered the files in the
patch so that the interesting stuff is near the top, and the
machine-generated stuff is at the bottom.
As you might suspect, most of this patch was done with a
one-liner--the moral equivalent of:
find . -xtype f | xargs perl -i -pe 's/struct\s+Parrot_Interp/Interp/'
(although I added some extra code to tell me how many changes were
made in each file).
There are a few files that used macros to shorten declarations
involving a "struct Parrot_Interp *"; these are now unnecessary and
occasionally counterproductive, but I haven't attempted to remove
them.
I've tested this out on my Linux box, navi:
Linux navi 2.4.18-opt #2 SMP Sun May 23 17:39:01 PDT 2004 i686 GNU/Linux
This is perl, v5.8.2 built for i686-linux-thread-multi
and everything seems to work. However, I'd appreciate testing from
people on other platforms, particularly ones with their own platform
files.
Testing or no, I'll apply this in a day or two if there are no objections.
--
Brent 'Dax' Royal-Gordon <br...@brentdax.com>
Perl and Parrot hacker
There is no cabal.
[I currently have a couple Gmail invites--contact me if you're interested.]
perl is "v5.8.1-RC3"
All tests successful, 4 tests and 52 subtests skipped.
Files=122, Tests=1943, 422 wallclock secs (181.27 cusr + 101.12 csys = 282.39 CPU)
Committed, then. Thanks.
http://www.brentdax.com/tmp/parrot.interp.patch
Has few bugs in it ;)
Index: config/gen/platform/platform_interface.h
struct parrot_string_t;
-struct Parrot_Interp;
-INTVAL Parrot_Run_OS_Command(struct Parrot_Interp*, struct parrot_string_t *);
-void Parrot_Exec_OS_Command(struct Parrot_Interp*, struct parrot_string_t *);
+Interp; // <<<<<<< OOPS
+INTVAL Parrot_Run_OS_Command(Interp*, struct parrot_string_t *);
+void Parrot_Exec_OS_Command(Interp*, struct parrot_string_t *);
Index: docs/memory_internals.pod
- typedef struct Parrot_Interp {
+ typedef Interp { //<<<<< OOPS
Would have been safer to do:
s/(struct\s+)Parrot_Interp/\1parrot_interp_t/gm;
Fred.