Subject: Re: Assming char == signed char?
To: None <tech-ports@NetBSD.ORG>
From: Christos Zoulas <christos@deshaw.com>
List: tech-ports
Date: 06/19/1995 16:52:15
In article <199506191544.LAA10768@Collatz.McRCIM.McGill.EDU> mouse@Collatz.McRCIM.McGill.EDU (der Mouse) writes:
>>> As an aside is the correct fix:
>>> 		(signed char)tty->a_member_of_type_char == -1
>> This is not a desirable fix, because it assumes that one has access
>> to an ansi compiler.
>
>Under what circumstances can this be untrue, seeing as how NetBSD ships
>with a version of gcc?  It's a mildly old gcc, true, but not so old it
>doesn't understand "signed char".
>

It has more to do with following the existing coding standards policy
which says:

    The code should be able to compile and run with a NON ansi compiler.

This is the reason for the __P() macro, and the reason why according to
the style document functions should be defined as:

int
func(a, b)
	int a;
	char *b;
{
}

as opposed to:

int
func(int a, char *b)
{
}

I know that there is code both in the kernel and in userland that does
not comply with the style standard, but at least it will not compile at
all with a K&R compiler, instead of producing the wrong result as it
would in the above case [with <sys/cdefs.h> defining signed to nothing].

christos