[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: spurious C warnings..



> >I originally learned C on PDP11's using K&R, and later on a
> >6809 home system - so I still tend to avoid making assumptions
> >about the size of an int...
> 
> Good policy. But "back in the day" there wasn't much difference
> made between an unsigned int and a char *. I've used a couple of
> machines in which they were different sizes, and on one machine a NULL
> pointer could have the value 0x80000000, while an int was
> 16 bits.

I have come across that situation also. I think the Cyber used to
have 60 bit integers (X registers) and 18 bit addresses (A registers).

ANSI compilers certainly make the distinction now, but from what I
recall 6th edition Unix used 'char *' as a way to get an unsigned
int, because the 'unsigned' keyword was yet to appear.

> >Anyway, your explanation makes sense.
> 
> Yeah, especially for floats that is needed. I mean,
> a long long has more bits which can't be generated out
> of nothing. So 0.1L has more significant bits in it
> than 0.1, and there you go.

Yes, I hadn't thought of that - I tend to do mostly system
level stuff where floats don't appear much ;)

> >Is the standard available online somewhere?
> 
> Yes and no. It may be *purchased* online. There are also
> draft copies online which are free, but are not *exactly*
> what was adopted as the final draft. Look for N9724.pdf and
> N9724.txt with Google, or I can shoot you an e-mail with
> a copy of either, as these are the last drafts before
> adoption. AIUI, there is very little difference in wording,
> and no difference in semantics.

If you wouldn't mind, that would be handy, thanks.

I tried a search, and it is amazing how many documents have an
N9724 code, most of which look a little unpromising, eg..

	Walt Disney's Comics and Stories No. 224 Comic Book
	... Status: For Sale. Reference#: N9724. Condition..

Regards,
DigbyT
-- 
Digby R. S. Tarvin                                          digbyt(at)digbyt.com
http://www.digbyt.com



Reply to: