P
pete
Keith said:the DS9K, or DeathStar 9000,
Death Station 9000.
Keith said:the DS9K, or DeathStar 9000,
pete said:Death Station 9000.
Alexei A. Frounze said:...
Guys, is it absolutely required to respond like this? And what's
funny or bad in that I'm a Russian? What have I done to you to
read this now? Why do I get such a response in this group 2nd time
this week?
The DS9K has been famous in this group for many years. It is
really a thought experiment, to demonstrate what can legitimately
happen when you contravene the standards in any way. Since
absolutely anything goes when UB is invoked, there are some
competitions to imagine results suitable for the particular case.
Somebody ran nonconforming programs on it on November Tuesdays in
2000 and 2004, and look what happened!
Your being Russian has nothing to do with it.
Keith said:The point is that the DS9K, or DeathStar 9000, is a purely mythical
computer system, invented in this newsgroup and never actually
implemented.
Netocrat said:.... snip ...
Alexei can correct me if I'm wrong, but I believe his complaint was
against Mark's use of the phrase "send signed photos of your bottom to
the patriarch of moscow", which Alexei has interpreted (rightly or
wrongly - only Mark can answer that) as being a reference to Alexei
being Russian. I don't believe he was specifically complaining about
the use of the DS9K thought experiment as an explanation as Keith and
yourself have interpreted him as doing.
Malcolm said:Not much. It can be used as an integer between -128 and 127. However almost
always you are better off with a plain int or, if memory is at a premium,
with a bitfield.
Thanks for all your thoughts and comments. I now believe the following
to be true:
A signed char should only be used where C99 is not available and
space is a consideration.
Thanks for all your thoughts and comments. I now believe the following
to be true:
A signed char should only be used where C99 is not available and
space is a consideration.
Richard said:That seems like a reasonable summary. In practice, you'll probably never
need one. Certainly not on the "desktop", anyway.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
mail: rjh at above domain
Buf if I'm storing an integer then surly it would be better to use an
integer type?
If I'm worried about space then I could use int8_t (from
C99 stdint.h).
As I understand it unless I use the stdint.h types I
have no guarantee over size, not even for a char.
Am I not right in suggesting that 'char' should be used for characters
and 'int' should be used for integers?
If I am right then what is the
point of a signed char when no character set that I'm aware of uses
negative numbers?
That set me thinking about chars and signedness and what the purpose of
signed chars was post C99. The only time I ever think they would be
useful is on a non 8 bit system (say 5 bit or 13 bit), where an int
would be too small or too big.
Lawrence said:If int8_t exists then char must be an 8 bit type on that system. It
is very likely that where it exists int8_t will be typedef'd as char
or signed char. ...
Chris Dollin said:That set me thinking about chars and signedness and what the purpose of
signed chars was post C99. The only time I ever think they would be
useful is on a non 8 bit system (say 5 bit or 13 bit), where an int
would be too small or too big.
If an int is too small, a char would be too small also.
[And as far as C is concerned, a 5-bit system is likely to be
a 10-bit system.]
[Are 12-bit systems still in wide use?]
I know of 16-bit ones (char=short=int=16 bits, long=32 bits, long long=40
bits).
Chris Dollin said:That set me thinking about chars and signedness and what the purpose of
signed chars was post C99. The only time I ever think they would be
useful is on a non 8 bit system (say 5 bit or 13 bit), where an int
would be too small or too big.
If an int is too small, a char would be too small also.
[And as far as C is concerned, a 5-bit system is likely to be
a 10-bit system.]
[Are 12-bit systems still in wide use?]
I know of 16-bit ones (char=short=int=16 bits, long=32 bits, long long=40
bits).
Lawrence Kirby said:signed char is typically used to hold numbers rather than specifically
character values. The oddity is that plain char can be and often is
implemented as signed. That's just one of the historical quirks of C, the
language would be a lot cleaner if it was always unsigned.
Peter Nilsson said:I don't think that int8_t can be typedef'd as (plain) char in the
strictest sense. C99 states that "int8_t denotes a signed integer
type...", however plain char is not a signed integer type (per
6.2.5p4).
That said, the 'as if' rule applies!
Gordon Burditt said:[Are 12-bit systems still in wide use?]
I know of 16-bit ones (char=short=int=16 bits, long=32 bits, long long=40
bits).
That's rather strange. The number of bits in a long long isn't
a multiple of the number of bits in a char? I suppose C can handle this,
with sizeof(long long) == 3, and long long having 8 padding bits, but
it's rather unusual.
Are you sure you didn't mean long long = 48 bits?
What's the alignment requirement for long long? 2.5?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.