develooper Front page | perl.perl5.porters | Postings from February 2003

Re: How about gcc -funsigned-char [Was: Re: one signedness nit fo r Encode]

From:
Nicholas Clark
Date:
February 17, 2003 06:10
Subject:
Re: How about gcc -funsigned-char [Was: Re: one signedness nit fo r Encode]
Message ID:
20030217140931.B2347@plum.flirble.org
On Mon, Feb 17, 2003 at 03:54:52PM +0200, Jarkko Hietaniemi wrote:
> > I agree with you that people such be $#@!  explicit about the
> > signedness of their chars, based on my limited experience :-)
> 
> Make that declare as 'char' or 'unsigned char' and (cast) as
> appropriate.  Spelling 'signed char' out in full looks messy.

But having char as whatever-the-implementation-feels-like may be faster,
because on platforms where it is much easier to deal with 8 bit unsigned
quantities than 8 bit signed quantities, the compiler is able to make
your char (plain char) variables unsigned.

Why can't we have an -fundefined-behaviour flag that inserts checking code
that causes an undefined behaviour trap whenever the program executes
undefined code? Or are people banking on the massive undefinedness pool
generated by existing programs running with undetected undefined behaviour
to generate sufficient improbability to cause extremely unlikely (but
highly beneficial) events to occur. It's our only hope of a bug free release
of Windows.

Nicholas Clark



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