Clarity

COTTRELL, JAMES cottrell at NBS-VMS.ARPA
Thu Oct 10 11:13:16 AEST 1985


> > >Why add more symbols when you already have what is needed in the language?

Hey, all you *really* need is zero & one.

> > For clarity and portability.
> 
> Neither of those has been demonstrated.

Suppose I need an unsigned 20 bit number. The proper way to declare it
(ANSI) would be `unsigned long'. Fine. This will work in the future
when all compilers are ANSI. But suppose one just wants to tune his
application *just a bit* to his particular machine. OK, on VAXen &
such, `uint20' is `unsigned long'. On a Harris (24 bit int's &
48 bit longs, or so I hear) `uint20' can be `unsigned int'.

Now Doug, which would you rather do, port this guy's code, or
someone else's who hasn't even given a thought to portability?
At least his machine dependent stuff can be all in one header
file with profuse warnings in the installation documents. In fact,
that stuff might even be automatically selectable by #ifdef <machine>.

Also, the declaration says something extra about the range of values,
even if only to the nearest power of two. Possible enhancements might
be something like: #define int_minus_17_to_plus_53.


	jim		cottrell at nbs
*/
------



More information about the Comp.lang.c mailing list