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 26, 2013 15:25
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+vYcVwnSaZC2a9iKaRE-5y_BoavUH3pmPtwNQcnW8b6OqKXhw@mail.gmail.com
On Sat, Oct 26, 2013 at 4:27 AM, Father Chrysostomos via RT
<perlbug-followup@perl.org> wrote:
> On Sat Oct 26 02:11:01 2013, pcm wrote:
>> On Fri, Oct 25, 2013 at 12:24 AM, Father Chrysostomos via RT

>> On another note, can anyone provide context as to why our final
>> fallback to 'define bool char', except for VMS?  Couldn't we just
>> change *that* to be int everywhere, unless otherwise defined?
>
> That would increase memory usage on C89 compilers.
>
> (Why does VMS need int?)

It's been that way for 16 years:

<http://perl5.git.perl.org/perl.git/blobdiff/39e571d41067215a80f26089b260f1418caeb36b..61bb59065bf1b12edab39b124e7373fb357e2d73:/handy.h>

My memory (not from then but from a subsequent discussion) is that
there was an ancient C++ compiler on VMS that used int for bool and we
needed to make it compatible with that when compiling with C.  But
that reason is long since gone, especially since support for building
Perl with that C++ compiler was never completed and no recent (last
decade or more) C++ compiler uses int for bool.

Note that we don't even hit the ifdef path in question since admitting
to having stdbool.h a couple of years ago:

<http://perl5.git.perl.org/perl.git/commit/f29eb9c41faae36e349122c83174fb3ebfb7b350?f=configure.com>

but we've actually had stdbool.h since C 6.4, which came out in 2001.

It seems to me we are completely safe doing the following, but I will
do a test run or two before committing:

--- handy.h;-0 2013-09-19 08:51:06 -0500
+++ handy.h 2013-10-26 09:58:14 -0500
@@ -104,11 +104,7 @@ Null SV pointer. (No longer available wh
 #endif /* NeXT || __NeXT__ */

 #ifndef HAS_BOOL
-# if defined(VMS)
-#  define bool int
-# else
-#  define bool char
-# endif
+# define bool char
 # define HAS_BOOL 1
 #endif

[end]

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