It technically probably always should have. Void* (which has the same
format as char*) would have accepted either type pointer, char* shouldn't,
though I suspect that early compilers that predate void* would have happily
converted any pointer to char* (or int for that matter).
-----Original Message-----
From: TUHS <tuhs-bounces(a)minnie.tuhs.org> On Behalf Of Derek Fawcus
Sent: Sunday, May 17, 2020 12:11 PM
To: tuhs(a)tuhs.org
Subject: Re: [TUHS] v7 K&R C
On Fri, May 15, 2020 at 10:31:38PM +0100, Richard Tobin wrote:
"The implementation shall define char to have
the same range,
representation, and behavior as either signed char or unsigned char."
- C99
(Technically it's a separate type from both of them.)
I was about to suggest I'd yet to come across a compiler which handled them
that way, but on checking I find that both clang and gcc do now in effect
have 3 types.
i.e. both 'unsigned char *' and 'signed char *' values passed to a
function
taking 'char *' raises a warning.
I wonder when they started doing that?
DF