integral promotion., sign extension

N

Nick Keighley

no. plain "char" must have the same representation as one of the types
"signed char" or "unsignd char". It is implementaion defined which.
Soem implementaions even allow you to select it.

the implementaion defined people are correct you are mistaken.

Regarding Unsigned or signed character:
Project Configuration -> C/C++ -> Language tab, you can set the value
for "Default Char Unsigned". When you create a project, it would be
set to No by default. You can change it to Yes, if you want. The
compilter switch would be /J.

you are giving information about a particular implementation (I'd
guess a Windows system as it usually Windows people that make this
mistake). Other implementations do it some other way. Some don't allow
you modify it at all.


--
We recommend, rather, that users take advantage of the extensions of
GNU C and disregard the limitations of other compilers. Aside from
certain supercomputers and obsolete small machines, there is less
and less reason ever to use any other C compiler other than for
bootstrapping GNU CC.
(Using and Porting GNU CC)
 
E

Eric Sosman

[... in re imprecision of "narrower," in quotes ...]
If these four additional words had been present that would
have covered the point I was addressing in my previous response.
Glossing over minute technical details is no big deal.
But glossing over significant conceptual differences is, IMO,
a poor choice, even when explaining to beginners.

"Glossing over?" No, make that "?!!!" I said, right out,
that my use of words like "narrow" was imprecise and that I was
doing some hand-waving; that's "glossing over?" I wrote
>> [...] The formal definition of C uses a scheme of "integer
>> conversion ranks" to describe this stuff precisely, but I
>> thought that dragging that intricate business in would be
>> more confusing than enlightening. Stick with "wide" and
>> "narrow" for now, and promise yourself that you'll look up
>> "integer conversion rank" later, when you're more secure.)

.... and you call this "glossing over?" Sheesh.

Once again, pfui on yui.
 
T

Tim Rentsch

Eric Sosman said:
[... in re imprecision of "narrower," in quotes ...]
If these four additional words had been present that would
have covered the point I was addressing in my previous response.
Glossing over minute technical details is no big deal.
But glossing over significant conceptual differences is, IMO,
a poor choice, even when explaining to beginners.

"Glossing over?" No, make that "?!!!" I said, right out,
that my use of words like "narrow" was imprecise and that I was
doing some hand-waving; that's "glossing over?" I wrote
[...] The formal definition of C uses a scheme of "integer
conversion ranks" to describe this stuff precisely, but I
thought that dragging that intricate business in would be
more confusing than enlightening. Stick with "wide" and
"narrow" for now, and promise yourself that you'll look up
"integer conversion rank" later, when you're more secure.)

... and you call this "glossing over?" Sheesh.

I call it glossing over because a salient aspect is not
directly stated. Not because it isn't brought up in a
reference, not because it isn't explained in enough detail,
but because it isn't stated directly, even allowing the
statement to be fuzzy.
Once again, pfui on yui.

It seems like this is just a difference of opinion about
which details are important to include and which can
reasonably be left out. Why does that difference of
opinion provoke such a strong reaction?
 
B

Ben Bacarisse

It's a test to see if you're paying attention. :)

Actually, it does say a number of things about the sizes of integer
types, just indirectly.

In the case of unsigned char I'd say it does so directly.
 
B

Ben Bacarisse

pete said:
This section of the C99 standard:
7.10 Sizes of integer types <limits.h>
has neither the word "size" nor the word "byte", anywhere in it.

You did not, originally, reference 7.10, you just gave the name of the
section. 7.10 is two paragraphs and does all its work by referring to
the other section with that name: "5.2.4.2.1 Sizes of integer types
<limits.h>".

Was your original remark simply about 7.10? If so, I don't really see
the point you are making. The fact that 5.2.4.2.1 does not say much,
directly, about the sizes of integer types is surely more interesting.
 
B

Ben Bacarisse

pete said:
No. It was about 5.2.4.2.1,
but I forgot what the chapter and verse was.
When I searched the standard for the same phrase
so that I could post the C&V, I didn't know that there
were two places where it was, so when the search found
7.10 Sizes of integer types <limits.h>
I thought it was the same place.

Yes, it's confusing and 5.2.4.2.1 does include the word "byte"!

<snip>
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top