Re: [perl #42938] [BUG] allocation failures in res_lea.c

2007-06-01 Thread Mark Glines
On Thu, 31 May 2007 23:09:54 -0700 Mark Glines <[EMAIL PROTECTED]> wrote: > Might be worth it to prereserve 8 bytes or so, to avoid having to > realloc as often, if this will be called a lot. Currently it just > reallocs the minimum necessary to fit the existing string, the new > character and a n

mmd for bitwise_and causes a segfault with my pmc types

2007-06-01 Thread Mehmet Yavuz Selim Soyturk
Hello, I have two pmc classes PjsNumber and PjsBoolean, which define bitwise_and like this: PMC* bitwise_and(PMC* value, PMC* dest) { FLOATVAL a, b; if (! dest) { dest = pmc_new(INTERP, dynpmc_PjsNumber); } else if (dest->vtable->base_type != dynpmc_PjsNumber)

Re: [perl #41168] graceful "no compiler" error message?

2007-06-01 Thread chromatic
On Thursday 31 May 2007 18:01:55 James E Keenan wrote: > > "Invoking the compiler on a simple source file, then checking that the > > generated code exists seems such an obvious test that there must be a > > fatal flaw in it. What am I missing?" > > This patch grew out of Hackathon Toronto and was

Better GCC Visibility

2007-06-01 Thread chromatic
I think this patch fixes the visibility problem with Linux and GCC versions before 4.0. I think it also enables symbol hiding on other platforms with GCC. -- c === config/auto/gcc.pm == --- config/auto/gcc.pm (revision 3726) +++ c

Re: [svn:parrot] r18726 - trunk/include/parrot

2007-06-01 Thread chromatic
On Friday 01 June 2007 13:21:52 [EMAIL PROTECTED] wrote: > Log: > Add function attributes for noreturn to help GCC Are those C89 attributes? Do they break other compilers? -- c

Re: mmd for bitwise_and causes a segfault with my pmc types

2007-06-01 Thread Mehmet Yavuz Selim Soyturk
It seems to work in general, but in some cases (especially when I allocate too much memory) it causes me a segfault or an error like: Trace/breakpoint trap (core dumped) It was caused by some unitialized memory in src/mmd.c. rt #43105 solves it. -- Mehmet

[perl #43102] t/pmc/threads.t tests 5,7 fail with --gc=libc

2007-06-01 Thread via RT
# New Ticket Created by Mark Glines # Please include the string: [perl #43102] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=43102 > While testing/trying to fix RT #42938, I noticed an additional test failure in t/pmc/thre

Use const proactively

2007-06-01 Thread Andy Lester
From my wiki at http://xoa.petdance.com/Use_const_proactively Const your local variables The following is adapted from C++ Coding Standards by Herb Sutter and Andrei Alexandrescu (with some C++-specific stuff removed): const is your friend: Immutable values are easier to understand, t

[perl #43105] [PATCH] function mmd.c::mmd_expand_y: newly allocated memory unitialized

2007-06-01 Thread Mehmet Yavuz Selim Soyturk
# New Ticket Created by "Mehmet Yavuz Selim Soyturk" # Please include the string: [perl #43105] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=43105 > Function mmd_expand_y in src/mmd.c allocates new memory for the mmd tabl

Re: [svn:parrot] r18726 - trunk/include/parrot

2007-06-01 Thread Andy Lester
On Jun 1, 2007, at 3:26 PM, chromatic wrote: Log: Add function attributes for noreturn to help GCC Are those C89 attributes? Do they break other compilers? They're stolen from p5, and they're macros that go away if you don't define things like -DHASATTRIBUTE_NORETURN. I'm all over the

Use const proactively

2007-06-01 Thread Andy Lester
Here's a bit of an explanation of why I const like I do: http://xoa.petdance.com/Use_const_proactively One of my jobs in Perl 5 and Parrot has been to apply const as much as humanly possible. == Const your local variables The following is adapted from C++ Coding Standards by Herb Sutter and

Re: [perl #43105] [PATCH] function mmd.c::mmd_expand_y: newly allocated memory unitialized

2007-06-01 Thread chromatic
On Friday 01 June 2007 13:39:32 Mehmet Yavuz Selim Soyturk wrote: > Function mmd_expand_y in src/mmd.c allocates new memory for the mmd > table, but does not initialize the newy allocated memory to NULL, > which causes segfaults for some cases. The attached patch solves that > problem. I thought

Re: [svn:parrot] r18724 - in trunk/config: auto init/hints

2007-06-01 Thread Nicholas Clark
On Fri, Jun 01, 2007 at 01:04:48PM -0700, [EMAIL PROTECTED] wrote: > Log: > [Configure] Move the visibility hints into the GCC hints and enable it only > for GCC 4.x and later. This makes it work other places than Linux and fixes > the compilation for earlier GCC versions. Works for me! :-) T

[perl #43107] t/tools/pmc2cutils/05-gen_c: Warnings being thrown in testing of Parrot::Pmc2c::Pmc2cMain

2007-06-01 Thread via RT
# New Ticket Created by James Keenan # Please include the string: [perl #43107] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=43107 > --- osname= linux osvers= 2.6.15 arch= i386-linux-thread-multi cc= cc --- Flags:

[perl #43108] [PATCH] Getting Parrot compiled with C++ - Part one

2007-06-01 Thread via RT
# New Ticket Created by Steve Peters # Please include the string: [perl #43108] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=43108 > The attached patch gets Parrot partially compiles with C++ (g++ actually). This work get

SET_NULL

2007-06-01 Thread Andy Lester
From include/parrot/parrot.h: /* weird architectures might need this, s. C-FAQ 5.17 * * the SET_NULL macros are only for system, where a NULL pointer * isn't represented by zeroes, so don't use these, for resetting * non-null pointers */ #ifdef HAS_NON_ZERO_NULL # define SET_NULL(x) x = NULL #

Use const proactively

2007-06-01 Thread Andy Lester
Here's a bit of an explanation of why I const like I do: http://xoa.petdance.com/Use_const_proactively One of my jobs in Perl 5 and Parrot has been to apply const as much as humanly possible. == Const your local variables The following is adapted from C++ Coding Standards by Herb Sutter and

Re: [perl #43108] [PATCH] Getting Parrot compiled with C++ - Part one

2007-06-01 Thread chromatic
On Friday 01 June 2007 16:51:18 Steve Peters wrote: > The attached patch gets Parrot partially compiles with C++ (g++ actually). > This work gets the compile going through the start of the imcc compiler. Danger! The patch to src/stm/waitlist.c causes segfaults in t/stm/runtime.t, test 3: Progra

Re: SET_NULL

2007-06-01 Thread Steve Peters
On Fri, Jun 01, 2007 at 07:53:35PM -0500, Andy Lester wrote: > From include/parrot/parrot.h: > > /* weird architectures might need this, s. C-FAQ 5.17 > * > * the SET_NULL macros are only for system, where a NULL pointer > * isn't represented by zeroes, so don't use these, for resetting > * non-nu

Re: SET_NULL

2007-06-01 Thread Andy Lester
On Jun 1, 2007, at 8:20 PM, Steve Peters wrote: I can't see any need for such a macro other than for the minor obfuscation that it allows. For most of the Parrot code, I haven't SET_NULL() used, and I haven't used it myself. I'm a bit curious how much it is actually used. $ ack SET_N

Re: SET_NULL

2007-06-01 Thread Andy Lester
On Jun 1, 2007, at 8:20 PM, Steve Peters wrote: I can't see any need for such a macro other than for the minor obfuscation that it allows. For most of the Parrot code, I haven't SET_NULL() used, and I haven't used it myself. I'm a bit curious how much it is actually used. I know why we

[perl #43107] t/tools/pmc2cutils/05-gen_c: Warnings being thrown in testing of Parrot::Pmc2c::Pmc2cMain

2007-06-01 Thread Bob Rogers
From: James Keenan (via RT) <[EMAIL PROTECTED]> Date: Fri, 01 Jun 2007 16:46:06 -0700 Tonight, on both Linux and Darwin, I configured with the '--test' option to Configure.pl that runs, among other things, the build tools tests once Configure.pl itself has completed. These tests ge