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