Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site rtech.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!dual!unisoft!mtxinu!rtech!daveb
From: daveb@rtech.UUCP (Dave Brower)
Newsgroups: net.lang.c
Subject: Re: how has C bitten you -- unsigned/disnged chars.
Message-ID: <588@rtech.UUCP>
Date: Fri, 9-Aug-85 03:31:49 EDT
Article-I.D.: rtech.588
Posted: Fri Aug  9 03:31:49 1985
Date-Received: Wed, 14-Aug-85 02:39:39 EDT
References: <745@dataio.UUCP>
Organization: Relational Technology, Alameda CA
Lines: 49

> In article <5400010@prism.UUCP> matt@prism.UUCP writes:
> For most applications, it doesn't matter whether a char is signed or
> not, and so it is appropriate for the compiler to select that which
> can be implemented most efficiently. When it does matter, the programmer
> should take care (by explicitly declaring it as signed or unsigned).

When planning to support 8 bit characters for an international character
support, it is annoying that "strings in quotes" are the same thing as
the default (often signed) character type, when you really want them
to be unsigned.  This lint illustrates the situation.

1	iputs( s )
2	unsigned char * s;
3	{
4		while ( *s )
5			iputc( *s++ )
6	}
7
8	foo()
9	{
10		iputs( "hello dere\n" );
11	}

foo.c:
iputs, arg. 1 used inconsistently	foo.c(3)  ::  foo.c(10)

Now don't get me wrong, you *really should* say:

		iputs( (unsigned char *) "hello dere\n" );

and in a real international version you're more likely to have:

		extern unsigned char * msgs[];
		iputs( msgs[47] );

I'm just pointing it out as one of those annoyances one learns to tolerate.

BTW, I'm in favor of (void) printf() etc, if only DEC-C for VMS
supported the damn thing.  Now you need to be write it as VOID printf()
with VOID defined to be an appropriate cast or non-entity.  Ughly.

*sarcasm on*
Won't it be great when ANSI-C is implemented on EVERY machine you want
to use?
*sarcasm off*
-- 
{amdahl|dual|sun|zehntel}\		|"If his brains ran down, how could
{ucbvax|decvax}!mtxinu---->!rtech!daveb |he talk?"
ihnp4!{phoenix|amdahl}___/		|"Happens to people all the time...."