[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] char args passed to isalpha() et al.

From: Mike O'Dell
Subject: Re: [Nmh-workers] char args passed to isalpha() et al.
Date: Wed, 11 Apr 2007 12:12:39 -0400

the essential crock was C having "char" be anything other than "unsigned"
(or more accurately "unsigned int8" or "uint8")

if you want an 8-bit int, then support "int8" (along with the 
missing (int16 int32 and int64 types). an implementation should
be free to bind "int", "long", and "long long" to whatever is convenient
on the compilation target (one could even make the bindings adjustable
via a pragma, or or better yet, a command line argument to the compiler
if you really wanna be perverse)

the coding standards i've used for projects outlaw using raw "int"
declarations. one uses int8, int16, int32, int64, etc. true, C won't
do range checking at run-time,  but it makes the programmer think
at least once about the range of an integer value.

the Buddah Nature of C is that one *is* concerned with the byte size
of an integer at least as often as not. although it's way too late
to fix in "official C", this is one public service that "gcc"
could provide.  the fact it's not too hard to define the "standard C types"
in terms of this new model should make it possible to adopt for
at least new code.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]