Re: [PATCH] Pointer cast warnings in scripts/

Russell King
2005-06-22T11:25:20Z

On Wed, Jun 22, 2005 at 01:12:06PM +0200, Pierre Ossman wrote:
> That doesn't really make it a standard though (de facto perhaps). :)
> The odds of all those man pages deviating from the standard is probably
> very low. But unless someone has actually read the damn thing we won't
> know for sure.

You could check the C99 spec of course, which says gives (eg) strcmp as:

int strcmp(const char *s1, const char *s2);

rmk's rules of char:

1. use char for character strings and individual characters
2. use signed char if your data type relies upon negative char values
3. use unsigned char if your data type does not require negative char
values, especially if it makes use of the positive values not
present in the signed char range.

IOW, use signed/unsigned when you need to explicitly state your
requirements, but omit it for true strings and characters.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core