develooper Front page | perl.perl5.porters | Postings from October 2013

Re: [perl #120314] t/re/fold_grind.t spews tons of "Attempt to freetemp prematurely" warnings on DEBUGGING but ultimately passes

Thread Previous | Thread Next
From:
Craig A. Berry
Date:
October 30, 2013 14:39
Subject:
Re: [perl #120314] t/re/fold_grind.t spews tons of "Attempt to freetemp prematurely" warnings on DEBUGGING but ultimately passes
Message ID:
CA+vYcVx4ejM77AAopOQ7-hK7htg5C2XggM_MkqhWtJ019p1T4w@mail.gmail.com
On Wed, Oct 30, 2013 at 7:41 AM, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:

> When you sent your last message, I had already written the attached patch.  What do you think of this approach?

I like it; it's a clear, surgical exception to what the compiler would
do on its own.

> +On some platforms, C<bool> is defined as equivalent to C<char>.

s/some/pre-C99/

> +Consequently assignment of any larger type to a C<bool> is unsafe and may
> +be truncated.  The C<cBOOL> macro exists to cast it correctly.
> +
> +On those platforms and compilers where C<bool> really is a boolean (C++,
> +F<stdbool.h>), it is easy to forget the cast.  You can force C<bool> to be
> +a C<char> by compiling with C<-Accflags=-DPERL_BOOL_AS_CHAR>.

You may also wish to add C<-Werror=conversion> or local equivalent to
make it impossible to ignore the unsafe truncations.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About