What is the point of signed char?

A

Alexei A. Frounze

Clark S. Cox III said:
Then that's a non-conforming implementation (long long is too small).

Really? You mean the standard says long long is at least 64 bits? Well, even
if that's true, TI's compiler seems to be not only not conforming to the new
standard, but also having bugs in different places. They do great chips, but
their development tools suck.

Alex
 
K

Keith Thompson

Alexei A. Frounze said:
Really? You mean the standard says long long is at least 64 bits?

Yes. More precisely, the C99 standard requires the range of long long
to be at least -9223372036854775807 .. +9223372036854775807
(-2**63+1 .. 2**63-1).

But perhaps the compiler is a C90 compiler that supports long long as
an extension. If so, it doesn't fail to conform to the C90 standard,
at least for that reason.
 
M

Mark McIntyre

...

Guys, is it absolutely required to respond like this?

like what?
And what's funny or bad in that I'm a Russian?

Who said there was anything funny or bad about being 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?

You need to get a sense of humour. You also need to follow the link I
posted, and read all about the stuff that ART produce. Or rather, that
someone decided on the 1st of April many years ago, to pretend they
produced.
 
M

Mark McIntyre

On Thu, 21 Jul 2005 02:03:31 +0000, CBFalconer wrote:
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 as being a reference to Alexei
being Russian.

Certainly it was. I picked something that would be patently absurd to
Alexei. If it'd been a USAnian, I'd have suggested awarding a spoken
english degree to George W.
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.

Myself I think he just has an underdeveloped sense of humour, perhaps
because he's not been in CLC long enough, or because his english
skills are not good enough yet to spot the jokes.
 
P

Peter Nilsson

Keith said:
If you're correct that int8_t can't be typedef'ed as plain char, the
"as if" rule doesn't apply. The following would be illegal:

int8_t *iptr;
unsigned char *cptr;
cptr = iptr;

I'm not sure what you're demonstrating here. The code potentially
violates a constraint on any implementation, irrespective of whether
int8_t can be plain char or not.

AFAICS, implementations are allowed to make int8_t an exteneded integer
type. Consider an implementation where signed char is not 2c, but the
implementation can mimic a signed 2c octet integer.

But whether it's int8_t, size_t, time_t, etc..., no strictly
conforming C99 program can determine _which_ typedef was invoked.

That's the point I was making. The standard doesn't appear to allow
int8_t to be typedef-ed as a plain char, but the only way to check
it is by looking at the implementation source code (if any), which
is irrelevant.
 
K

Keith Thompson

Peter Nilsson said:
I'm not sure what you're demonstrating here. The code potentially
violates a constraint on any implementation, irrespective of whether
int8_t can be plain char or not.

You're right, I was being a bit sloppy. The point, I guess, is that
the above code fragment violates a constraint on any possible
conforming implementation. If an implementation chose to take
advantage of the "as if" rule, as Lawrence Kirby suggested, the lack
of a diagnostic would demonstrate that the implementation is
non-conforming.
AFAICS, implementations are allowed to make int8_t an exteneded integer
type. Consider an implementation where signed char is not 2c, but the
implementation can mimic a signed 2c octet integer.

But whether it's int8_t, size_t, time_t, etc..., no strictly
conforming C99 program can determine _which_ typedef was invoked.

That's the point I was making. The standard doesn't appear to allow
int8_t to be typedef-ed as a plain char, but the only way to check
it is by looking at the implementation source code (if any), which
is irrelevant.

Agreed, *except* that you can detect the non-conformance by the lack
of a diagnostic.
 
C

CBFalconer

Mark said:
Certainly it was. I picked something that would be patently absurd to
Alexei. If it'd been a USAnian, I'd have suggested awarding a spoken
english degree to George W.

Mark, please keep your attributions straight. I wrote NONE of what
you quoted.
 
N

Netocrat

Mark said:
Certainly it was. I picked something that would be patently absurd to
Alexei. If it'd been a USAnian, I'd have suggested awarding a spoken
english degree to George W.

Correction: on rereading his post I found that Keith's interpretation
was the same as mine.
Myself I think he just has an underdeveloped sense of humour, perhaps
because he's not been in CLC long enough, or because his english
skills are not good enough yet to spot the jokes.

"Look, I'm here to apply for the job of elephant handler - what the
hell relevance does being a midget have to do with my ability to do the
job?"

"When are they gonna stop calling me 'the new kid'?"

You obviously intended it to be taken as a joke put into a personalised
context rather than to provoke such feelings as the above (and my
examples are extreme cases not directly comparable to your joke), but
Alexei's response, particularly considering that he had earlier been
deliberately and unequivocally insulted using his Russian nationality
as part of the insult, does not necessarily stem from a lacking sense
of humour/english skill either.
 
C

Chris Hills

Peter 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!

MISRA-C (6.3) has

int8_t
uint8_t
char_t

as plain char is implementation defined.
 
C

Chris Hills

Keith Thompson <kst- said:
Yes. More precisely, the C99 standard requires the range of long long
to be at least -9223372036854775807 .. +9223372036854775807
(-2**63+1 .. 2**63-1).

But are there actually any C99 compilers in general use?
 
A

Alexei A. Frounze

Mark McIntyre said:
like what?


Who said there was anything funny or bad about being russian?


You need to get a sense of humour. You also need to follow the link I
posted, and read all about the stuff that ART produce. Or rather, that
someone decided on the 1st of April many years ago, to pretend they
produced.

Mark, if you feel I need a better sense of humor, so be it, but in return
I'd like to ask you to be more polite, watch your mouth. Yes, I've been to
that site and found the fun stuff you were talking about DS9K. That's fine
with the site and the jokes about DS9K, C, even the photos of my ass are OK
(no, I'm not saying, I'd taken a few and I or anyone else liked them, no,
but if you want I can make a few for you, if you're so interested in my ass
:). What is not OK, IMO, is when such jokes include relation to me as living
in Moscow/Russia or being Russian, or something else of my personality,
pointing to the fact that I'm different (from you or eveyone here, doesn't
matter). To me such a joke more as an insult, in which that particular
difference thing is *the cause* of the insult. How would you feel if I and
someone else (two or more people) called you twice or more times an American
dumass, which isn't really far from the thing you wrote? Wouldn't you
consider that something's wrong about these people or yourself? I would and
I believe it's not just me who would. Mind you, I had two such responses in
less than a week. I hope you didn't mean it, but I beg you not to do it
anymore, neither unconsciously nor on purpose. People may not like it.

Alex
 
A

Alexei A. Frounze

Mark McIntyre said:
like what?


Who said there was anything funny or bad about being russian?


You need to get a sense of humour. You also need to follow the link I
posted, and read all about the stuff that ART produce. Or rather, that
someone decided on the 1st of April many years ago, to pretend they
produced.

Mark, if you feel I need a better sense of humor, so be it, but in return
I'd like to ask you to be more polite, watch your mouth. Yes, I've been to
that site and found the fun stuff you were talking about DS9K. That's fine
with the site and the jokes about DS9K, C, even the photos of my ass are OK
(no, I'm not saying, I'd taken a few and I or anyone else liked them, no,
but if you want I can make a few for you, if you're so interested in my ass
:). What is not OK, IMO, is when such jokes include relation to me as living
in Moscow/Russia or being Russian, or something else of my personality,
pointing to the fact that I'm different (from you or eveyone here, doesn't
matter). To me such a joke is more of an insult, in which that particular
difference thing is *the cause* of the insult. How would you feel if I and
someone else (two or more people) called you twice or more times an American
dumass and apparently emphasizing your being American? And that isn't really
far from the thing you wrote. Wouldn't you consider that something's wrong
about these people or yourself? I would and I believe it's not just me who
would. Mind you, I had two such responses in less than a week. I hope you
didn't mean it and I don't ask for any apologies, but I beg you not to do it
anymore, neither unconsciously nor on purpose. People may not like it.
Worse, you can't be sure that none decides to beat you up for such your
words. Some people would consider beating you up as a perfect response. So,
don't tempt the fate, or there may be someone after your own ass. :)

Alex
 
R

Richard Heathfield

Alexei said:
How would you feel if I and
someone else (two or more people) called you twice or more times an
American dumass and apparently emphasizing your being American?

It's worse than that, Alexei - Mark is Scottish. :)

Mark wasn't trying to get on your case, honestly. He was a bit thoughtless,
and he's been using comp.lang.c for long enough that he sometimes confuses
thoughtlessness with efficiency. Many of us have been guilty of the same
thing.

At the moment, you have the sympathy of this newsgroup. Your best strategy
is to forgive Mark for being momentarily thoughtless, and get on with
discussing C rather than national sensitivities.

If he gives any more trouble, just shove his haggis up his sporran. That'll
sort him out. :)
 
A

Alexei A. Frounze

Richard Heathfield said:
It's worse than that, Alexei - Mark is Scottish. :)

It's hard to tell Scottish :) Let calling him American be the punishment :))
Mark wasn't trying to get on your case, honestly. He was a bit thoughtless,
and he's been using comp.lang.c for long enough that he sometimes confuses
thoughtlessness with efficiency. Many of us have been guilty of the same
thing.

Well, that happens. Sometimes I'm bing picky or a bit harsh too. But I don't
write anything about one's place of living, nationality or religion in such
a way.
At the moment, you have the sympathy of this newsgroup. Your best strategy
is to forgive Mark for being momentarily thoughtless, and get on with
discussing C rather than national sensitivities.

OK. That's why I'm still subscribed for it, though I've already got the
answer to my C question.
If he gives any more trouble, just shove his haggis up his sporran. That'll
sort him out. :)

He won't be able to stand such a shame and die. That's inhumane :)

Alex
 
K

Keith Thompson

Chris Hills said:
MISRA-C (6.3) has

int8_t
uint8_t
char_t

as plain char is implementation defined.

What the heck is char_t? If it's a typedef for plain char, why not
just use plain char? Likewise for signed char or unsigned char.
 
M

Mark McIntyre

I don't know, do you think its something you're likely to say? *
It's hard to tell Scottish :) Let calling him American be the punishment :))

Yeah, that fightin' talk. I'll see you outside laddie... :)
He won't be able to stand such a shame and die. That's inhumane :)

Nah, it just gets a bit smelly after a couple of weeks.

* this is a quote from HHG2G by the way. If you've not read it - do.
 
M

Mark McIntyre

Mark, please keep your attributions straight. I wrote NONE of what
you quoted.

Whoops, snipped not quite enough. Netocrat said all that. Many
apologies.
 
M

Mark McIntyre

You obviously intended it to be taken as a joke put into a personalised
context

Yup.
Alexei's response, particularly considering that he had earlier been
deliberately and unequivocally insulted using his Russian nationality
as part of the insult,

Had he? I wasn't aware of that.
does not necessarily stem from a lacking sense
of humour/english skill either.

*shrug*. Personally, I felt that his reaction was over the top, but
not untypical of some fols I know who have either a lack of sense of
humour, or an overinflated sense of national importance, or a lack of
english skills. Obviously other opinions exist.
 
C

Chris Croughton

I don't know, do you think its something you're likely to say? *

Yeah, that fightin' talk. I'll see you outside laddie... :)

The Scots are all Irish living in wheelbarrows. Or was that the Picts?
Nah, it just gets a bit smelly after a couple of weeks.

It's also child abuse, since a sporran is a young haggis as eny fule no.
Personally, I prefer them in their old age as bagpipes...
* this is a quote from HHG2G by the way. If you've not read it - do.

The book and radio versions, at least. Is it in the recent film? I
haven't seen it yet.

Chris C
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
474,167
Messages
2,570,911
Members
47,453
Latest member
MadelinePh

Latest Threads

Top