Connecting Tech Pros Worldwide Forums | Help | Site Map

FAQ issue: Guaranteed value ranges of fundamental types?

Alf P. Steinbach
Guest
 
Posts: n/a
#1: Jul 23 '05
The C++ FAQ item 29.5 (this seems to be strongly related to C), at
<url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
mentions that

<quote>
C++ guarantees a char is exactly one byte which is at least 8 bits, short
is at least 16 bits, int is at least 16 bits, and long is at least 32
bits.
</quote>


Questions:

(1) This guarantee seems to come from the C standard. Which I don't
have. Does the C++ standard really guarantee this?

(2) Is this guarantee originally formulated in terms of number of bits,
or in terms of e.g. decimal value ranges?

(3) Concerning (2), if formulated in terms of number of bits, are the number
of bits mentioned simply sizeof(T)*CHAR_BIT, which doesn't say much about
value ranges, or are they stated to be the value representation bits?


(Intentionally cross-posted [comp.lang.c++] and [comp.lang.c]).

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

pete
Guest
 
Posts: n/a
#2: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Alf P. Steinbach wrote:[color=blue]
>
> The C++ FAQ item 29.5 (this seems to be strongly related to C), at
> <url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
> mentions that
>
> <quote>
> C++ guarantees a char is exactly
> one byte which is at least 8 bits, short
> is at least 16 bits, int is at least 16 bits,
> and long is at least 32 bits.
> </quote>
>
> Questions:
>
> (1) This guarantee seems to come from the C standard. Which I don't
> have. Does the C++ standard really guarantee this?
>
> (2) Is this guarantee originally
> formulated in terms of number of bits,
> or in terms of e.g. decimal value ranges?[/color]

The part of the C standard which is called
"Sizes of integral types" in C89 and
"Sizes of integer types" in C99,
is specified in terms of ranges.

C99 describes padding bits for integer types.

--
pete
CBFalconer
Guest
 
Posts: n/a
#3: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


"Alf P. Steinbach" wrote:[color=blue]
>
> The C++ FAQ item 29.5 (this seems to be strongly related to C), at
> <url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
> mentions that
>
> <quote>
> C++ guarantees a char is exactly one byte which is at least 8
> bits, short is at least 16 bits, int is at least 16 bits, and
> long is at least 32 bits.
> </quote>
>
> Questions:
>
> (1) This guarantee seems to come from the C standard. Which I
> don't have. Does the C++ standard really guarantee this?[/color]

I dunno. This is c.l.c. Google for N869 to get the last draft of
the C standard. f'ups set, which you should have done in the
original posting.
[color=blue]
>
> (2) Is this guarantee originally formulated in terms of number of
> bits, or in terms of e.g. decimal value ranges?[/color]

By values. Other specifications translate that into viable bits.
[color=blue]
>
> (3) Concerning (2), if formulated in terms of number of bits, are
> the number of bits mentioned simply sizeof(T)*CHAR_BIT, which
> doesn't say much about value ranges, or are they stated to be
> the value representation bits?[/color]

No, because there may be bits for other purposes, such as trap
values.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson


Alf P. Steinbach
Guest
 
Posts: n/a
#4: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


* CBFalconer:[color=blue]
> "Alf P. Steinbach" wrote:[color=green]
> >
> > The C++ FAQ item 29.5 (this seems to be strongly related to C), at
> > <url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
> > mentions that
> >
> > <quote>
> > C++ guarantees a char is exactly one byte which is at least 8
> > bits, short is at least 16 bits, int is at least 16 bits, and
> > long is at least 32 bits.
> > </quote>
> >
> > Questions:
> >
> > (1) This guarantee seems to come from the C standard. Which I
> > don't have. Does the C++ standard really guarantee this?[/color]
>
> I dunno. This is c.l.c. Google for N869 to get the last draft of
> the C standard. f'ups set, which you should have done in the
> original posting.[/color]

It was intentionally cross-posted; F.U.T. overridden. :-)

Thanks for the "N869" reference.

Yes, the C standard specifies those minimum ranges in the documentation
of [limits.h], which the C++ standard refers to the C standard for.

[color=blue][color=green]
> > (2) Is this guarantee originally formulated in terms of number of
> > bits, or in terms of e.g. decimal value ranges?[/color]
>
> By values. Other specifications translate that into viable bits.[/color]

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Ioannis Vranos
Guest
 
Posts: n/a
#5: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Alf P. Steinbach wrote:
[color=blue]
> The C++ FAQ item 29.5 (this seems to be strongly related to C), at
> <url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
> mentions that
>
> <quote>
> C++ guarantees a char is exactly one byte which is at least 8 bits, short
> is at least 16 bits, int is at least 16 bits, and long is at least 32
> bits.
> </quote>
>
>
> Questions:
>
> (1) This guarantee seems to come from the C standard. Which I don't
> have. Does the C++ standard really guarantee this?[/color]


Yes. Also, except where otherwise is stated, C90 is a subset of C++98
standard.


[color=blue]
> (2) Is this guarantee originally formulated in terms of number of bits,
> or in terms of e.g. decimal value ranges?[/color]


Decimal ranges. C90 defines the following (from the last C90 draft):


"Sizes of integral types <limits.h>

The values given below shall be replaced by constant expressions
suitable for use in #if preprocessing directives. Their
implementation-defined values shall be equal or greater in magnitude
(absolute value) to those shown, with the same sign.

* maximum number of bits for smallest object that is not a bit-field
(byte)
CHAR_BIT 8

* minimum value for an object of type signed char
SCHAR_MIN -127

* maximum value for an object of type signed char
SCHAR_MAX +127

* maximum value for an object of type unsigned char
UCHAR_MAX 255

* minimum value for an object of type char
CHAR_MIN see below

* maximum value for an object of type char
CHAR_MAX see below

* maximum number of bytes in a multibyte character, for any
supported locale
MB_LEN_MAX 1

* minimum value for an object of type short int
SHRT_MIN -32767

* maximum value for an object of type short int
SHRT_MAX +32767

* maximum value for an object of type unsigned short int
USHRT_MAX 65535

* minimum value for an object of type int
INT_MIN -32767

* maximum value for an object of type int
INT_MAX +32767

* maximum value for an object of type unsigned int
UINT_MAX 65535

* minimum value for an object of type long int
LONG_MIN -2147483647

* maximum value for an object of type long int
LONG_MAX +2147483647

* maximum value for an object of type unsigned long int
ULONG_MAX 4294967295


If the value of an object of type char sign-extends when used in
an expression, the value of CHAR_MIN shall be the same as that of
SCHAR_MIN and the value of CHAR_MAX shall be the same as that of
SCHAR_MAX . If the value of an object of type char does not sign-extend
when used in an expression, the value of CHAR_MIN shall be 0 and the
value of CHAR_MAX shall be the same as that of UCHAR_MAX./7/"



[color=blue]
> (3) Concerning (2), if formulated in terms of number of bits, are the number
> of bits mentioned simply sizeof(T)*CHAR_BIT, which doesn't say much about
> value ranges, or are they stated to be the value representation bits?[/color]


Apart from char, and unsigned char that are guaranteed to not have
padding bits (anyone may tell about signed char?), the number of bits
of a type may contain padding bits etc.




--
Ioannis Vranos

http://www23.brinkster.com/noicys
Andreas Huber
Guest
 
Posts: n/a
#6: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Alf P. Steinbach wrote:
[snip][color=blue]
> short is at least 16 bits, int is at least 16 bits, and long
> is at least 32 bits.
> </quote>[/color]

That is contrary to what my copy of the standard says (see 3.9.1/1). It
basically says that char <= short <= int <= long (i.e. there is no
guarantee that a long is any bigger than a char, although there probably
is no platform where sizeof(long) == sizeof(char)). For more information
see 5.3.3 and 1.7..

Regards,

--
Andreas Huber

When replying by private email, please remove the words spam and trap
from the address shown in the header.

Victor Bazarov
Guest
 
Posts: n/a
#7: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


"Andreas Huber" <ahd6974-spamgroupstrap@yahoo.com> wrote...[color=blue]
> Alf P. Steinbach wrote:
> [snip][color=green]
>> short is at least 16 bits, int is at least 16 bits, and long
>> is at least 32 bits.
>> </quote>[/color]
>
> That is contrary to what my copy of the standard says (see 3.9.1/1). It
> basically says that char <= short <= int <= long (i.e. there is no[/color]

I wonder what _exactly_ does your copy say in 3.9.1/1 that makes you
derive that 'char <= short <= int'. But that doesn't matter. You are
actually correct, the C standard defined those relationships between
type sizes. It is true that char <= short <= int. It does not, however,
mean that there is no guarantee that 'int' is larger than 'char'. The
same C90 Standard when describing <limits.h> (and see 18.2.2/2 to know
that C++ mandates the same values for all xx_MAX and xx_MIN values),
does require *at least* ranges -32767..32767 for 'int' and -2^31..2^31
for 'long'.
[color=blue]
> guarantee that a long is any bigger than a char, although there probably
> is no platform where sizeof(long) == sizeof(char)). For more information
> see 5.3.3 and 1.7..[/color]

For more information see 18.2.2

V


infobahn
Guest
 
Posts: n/a
#8: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Victor Bazarov wrote:[color=blue]
>
> I wonder what _exactly_ does your copy say in 3.9.1/1 that makes you
> derive that 'char <= short <= int'. But that doesn't matter. You are
> actually correct, the C standard defined those relationships between
> type sizes.[/color]

C&V please.
Victor Bazarov
Guest
 
Posts: n/a
#9: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


"infobahn" <infobahn@btinternet.com> wrote...[color=blue]
> Victor Bazarov wrote:[color=green]
>>
>> I wonder what _exactly_ does your copy say in 3.9.1/1 that makes you
>> derive that 'char <= short <= int'. But that doesn't matter. You are
>> actually correct, the C standard defined those relationships between
>> type sizes.[/color]
>
> C&V please.[/color]

I don't have a copy of C90. I used to have a printed copy at work,
but I don't work there any longer. I can be mistaken, therefore.

V


Keith Thompson
Guest
 
Posts: n/a
#10: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


"Andreas Huber" <ahd6974-spamgroupstrap@yahoo.com> writes:[color=blue]
> Alf P. Steinbach wrote:
> [snip][color=green]
>> short is at least 16 bits, int is at least 16 bits, and long
>> is at least 32 bits.
>> </quote>[/color]
>
> That is contrary to what my copy of the standard says (see
> 3.9.1/1). It basically says that char <= short <= int <= long
> (i.e. there is no guarantee that a long is any bigger than a char,
> although there probably is no platform where sizeof(long) ==
> sizeof(char)). For more information see 5.3.3 and 1.7..[/color]

There's no contradiction.

The C standard guarantees that short and int are at least 16 bits, and
long is at least 32 bits (it states these in terms of minimum ranges,
but the requirement for a binary representation implies the sizes
given). It also guarantees that int as at least as wide as short, and
long is at least as wide as int. (Padding bits mean that this applies
to the ranges, not the sizes.)

I think the C++ standard has the same guarantees.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Andreas Huber
Guest
 
Posts: n/a
#11: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Victor Bazarov wrote:[color=blue]
> "Andreas Huber" <ahd6974-spamgroupstrap@yahoo.com> wrote...[color=green]
>> Alf P. Steinbach wrote:
>> [snip][color=darkred]
>>> short is at least 16 bits, int is at least 16 bits, and long
>>> is at least 32 bits.
>>> </quote>[/color]
>>
>> That is contrary to what my copy of the standard says (see 3.9.1/1).
>> It basically says that char <= short <= int <= long (i.e. there is no[/color]
>
> I wonder what _exactly_ does your copy say in 3.9.1/1 that makes you
> derive that 'char <= short <= int'.[/color]

I was wrong, it's actually 3.9.1/2...
[color=blue]
> But that doesn't matter. You are
> actually correct, the C standard defined those relationships between
> type sizes. It is true that char <= short <= int. It does not,
> however, mean that there is no guarantee that 'int' is larger than
> 'char'. The same C90 Standard when describing <limits.h> (and see
> 18.2.2/2 to know that C++ mandates the same values for all xx_MAX and
> xx_MIN values), does require *at least* ranges -32767..32767 for
> 'int' and -2^31..2^31 for 'long'.
>[color=green]
>> guarantee that a long is any bigger than a char, although there
>> probably is no platform where sizeof(long) == sizeof(char)). For
>> more information see 5.3.3 and 1.7..[/color]
>
> For more information see 18.2.2[/color]

<blush> Ok, you got me on the left foot there. Although the C++ standard
does not itself guarantee anything like that, it *refers* to C standard
of which I don't even have a copy available... oh well.

Thanks for clarifying.

Regards,

--
Andreas Huber

When replying by private email, please remove the words spam and trap
from the address shown in the header.

CBFalconer
Guest
 
Posts: n/a
#12: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


"Alf P. Steinbach" wrote:[color=blue]
> CBFalconer:[color=green]
>> "Alf P. Steinbach" wrote:[color=darkred]
>>>[/color][/color][/color]
.... snip ...[color=blue][color=green][color=darkred]
>>>
>>> (1) This guarantee seems to come from the C standard. Which I
>>> don't have. Does the C++ standard really guarantee this?[/color]
>>
>> I dunno. This is c.l.c. Google for N869 to get the last draft of
>> the C standard. f'ups set, which you should have done in the
>> original posting.[/color]
>
> It was intentionally cross-posted; F.U.T. overridden. :-)[/color]

You got your inputs from c.l.c, now it should go away. That's why
you should have set fups in the first place, and not have
overridden mine. Notice I didn't object to the initial cross-post.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson


CBFalconer
Guest
 
Posts: n/a
#13: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Ioannis Vranos wrote:[color=blue]
> Alf P. Steinbach wrote:
>[/color]
.... snip ...[color=blue][color=green]
>>
>> (1) This guarantee seems to come from the C standard. Which I
>> don't have. Does the C++ standard really guarantee this?[/color]
>
> Yes. Also, except where otherwise is stated, C90 is a subset of
> C++98 standard.[/color]

See what happens when you don't set followups in the initial
query. Misinformation like this works its way into c.l.c and is
likely to produce an interminable stupid cross group argument.
It's bad enough when the misinformation is native to the group.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson


Jack Klein
Guest
 
Posts: n/a
#14: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Sat, 05 Feb 2005 13:11:04 GMT, alfps@start.no (Alf P. Steinbach)
wrote in comp.lang.c:
[color=blue]
> The C++ FAQ item 29.5 (this seems to be strongly related to C), at
> <url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
> mentions that
>
> <quote>
> C++ guarantees a char is exactly one byte which is at least 8 bits, short
> is at least 16 bits, int is at least 16 bits, and long is at least 32
> bits.
> </quote>
>
>
> Questions:
>
> (1) This guarantee seems to come from the C standard. Which I don't
> have. Does the C++ standard really guarantee this?[/color]

[snip]

The fact that the C++ standard decided to cite the C standard as a
normative reference is irrelevant here in comp.lang.c. The POSIX
standard is also based on the C standard, but that doesn't make POSIX
topical in comp.lang.c either.

What the C++ language guarantees is 100% off-topic in c.l.c, period.
The fact that the C++ standard does or does not refer to any or all
parts of the C standard has no meaning at all in terms of C.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Alf P. Steinbach
Guest
 
Posts: n/a
#15: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


* Jack Klein:[color=blue]
> On Sat, 05 Feb 2005 13:11:04 GMT, alfps@start.no (Alf P. Steinbach)
> wrote in comp.lang.c:
>[color=green]
> > The C++ FAQ item 29.5 (this seems to be strongly related to C), at
> > <url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
> > mentions that
> >
> > <quote>
> > C++ guarantees a char is exactly one byte which is at least 8 bits, short
> > is at least 16 bits, int is at least 16 bits, and long is at least 32
> > bits.
> > </quote>
> >
> >
> > Questions:
> >
> > (1) This guarantee seems to come from the C standard. Which I don't
> > have. Does the C++ standard really guarantee this?[/color]
>
> [snip]
>
> The fact that the C++ standard decided to cite the C standard as a
> normative reference is irrelevant here in comp.lang.c. The POSIX
> standard is also based on the C standard, but that doesn't make POSIX
> topical in comp.lang.c either.
>
> What the C++ language guarantees is 100% off-topic in c.l.c, period.
> The fact that the C++ standard does or does not refer to any or all
> parts of the C standard has no meaning at all in terms of C.[/color]

You mean, you don't have the slightest clue about the C aspects (although
you could easily check up on that, since you do have that standard), and
therefore choose to answer the 1/3 C++ part -- with some sour grapes.

Have a nice weekend.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jack Klein
Guest
 
Posts: n/a
#16: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Sun, 06 Feb 2005 02:16:08 GMT, alfps@start.no (Alf P. Steinbach)
wrote in comp.lang.c:
[color=blue]
> * Jack Klein:[color=green]
> > On Sat, 05 Feb 2005 13:11:04 GMT, alfps@start.no (Alf P. Steinbach)
> > wrote in comp.lang.c:
> >[color=darkred]
> > > The C++ FAQ item 29.5 (this seems to be strongly related to C), at
> > > <url: http://www.parashift.com/c++-faq-lite/newbie.html#faq-29.5>
> > > mentions that
> > >
> > > <quote>
> > > C++ guarantees a char is exactly one byte which is at least 8 bits, short
> > > is at least 16 bits, int is at least 16 bits, and long is at least 32
> > > bits.
> > > </quote>
> > >
> > >
> > > Questions:
> > >
> > > (1) This guarantee seems to come from the C standard. Which I don't
> > > have. Does the C++ standard really guarantee this?[/color]
> >
> > [snip]
> >
> > The fact that the C++ standard decided to cite the C standard as a
> > normative reference is irrelevant here in comp.lang.c. The POSIX
> > standard is also based on the C standard, but that doesn't make POSIX
> > topical in comp.lang.c either.
> >
> > What the C++ language guarantees is 100% off-topic in c.l.c, period.
> > The fact that the C++ standard does or does not refer to any or all
> > parts of the C standard has no meaning at all in terms of C.[/color]
>
> You mean, you don't have the slightest clue about the C aspects (although
> you could easily check up on that, since you do have that standard), and
> therefore choose to answer the 1/3 C++ part -- with some sour grapes.[/color]

Yes, I do, and had you posted this to comp.lang.c++ ONLY, I would have
been happy to answer based on what the C++ standard inherits from the
C standard.

But whether the C++ standard decided to incorporate the C standard in
its entirety, which it does not, or decided to only incorporate the
third comma on page 47, which it also does not, it not a C language
issue or topical for comp.lang.c at all.

There is no mention of the C++ language at all in the (now superceded
version) of the C standard that C++ chose to incorporate.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
..lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Mark McIntyre
Guest
 
Posts: n/a
#17: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Sat, 5 Feb 2005 20:30:18 +0000 (UTC), in comp.lang.c , infobahn
<infobahn@btinternet.com> wrote:
[color=blue]
>Victor Bazarov wrote:[color=green]
>>
>> I wonder what _exactly_ does your copy say in 3.9.1/1 that makes you
>> derive that 'char <= short <= int'. But that doesn't matter. You are
>> actually correct, the C standard defined those relationships between
>> type sizes.[/color]
>
>C&V please.[/color]

5.2.4.2.1 Sizes of Integral types.




--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Mark McIntyre
Guest
 
Posts: n/a
#18: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Sun, 06 Feb 2005 02:16:08 GMT, in comp.lang.c , alfps@start.no (Alf P.
Steinbach) wrote:
[color=blue]
>* Jack Klein:[color=green]
>>
>> What the C++ language guarantees is 100% off-topic in c.l.c, period.
>> The fact that the C++ standard does or does not refer to any or all
>> parts of the C standard has no meaning at all in terms of C.[/color]
>
>You mean, you don't have the slightest clue about the C aspects[/color]

Before posting such remarks, you might want to check up on Jack's
credentials, posting history etc. You just made a fool of yourself.


--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Keith Thompson
Guest
 
Posts: n/a
#19: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Mark McIntyre <markmcintyre@spamcop.net> writes:[color=blue]
> On Sat, 5 Feb 2005 20:30:18 +0000 (UTC), in comp.lang.c , infobahn
> <infobahn@btinternet.com> wrote:
>[color=green]
>>Victor Bazarov wrote:[color=darkred]
>>>
>>> I wonder what _exactly_ does your copy say in 3.9.1/1 that makes you
>>> derive that 'char <= short <= int'. But that doesn't matter. You are
>>> actually correct, the C standard defined those relationships between
>>> type sizes.[/color]
>>
>>C&V please.[/color]
>
> 5.2.4.2.1 Sizes of Integral types.[/color]

Which actually discusses the ranges of integer types, which, in the
presence of padding bits, may not be directly related to their sizes.
A sufficiently perverse implementation could have
sizeof(long) < sizeof(int).

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Alf P. Steinbach
Guest
 
Posts: n/a
#20: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


* Mark McIntyre:[color=blue]
> On Sun, 06 Feb 2005 02:16:08 GMT, in comp.lang.c , alfps@start.no (Alf P.
> Steinbach) wrote:
>[color=green]
> >* Jack Klein:[color=darkred]
> >>
> >> What the C++ language guarantees is 100% off-topic in c.l.c, period.
> >> The fact that the C++ standard does or does not refer to any or all
> >> parts of the C standard has no meaning at all in terms of C.[/color]
> >
> >You mean, you don't have the slightest clue about the C aspects[/color]
>
> Before posting such remarks, you might want to check up on Jack's
> credentials, posting history etc.[/color]

I know Jack's posting history for several years.

[color=blue]
> You just made a fool of yourself.[/color]

Before posting such remarks, you might want to check up on my
credentials, posting history etc.

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Alf P. Steinbach
Guest
 
Posts: n/a
#21: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


* Jack Klein:[color=blue]
> But whether the C++ standard decided to incorporate the C standard in
> its entirety, which it does not, or decided to only incorporate the
> third comma on page 47, which it also does not, it not a C language
> issue or topical for comp.lang.c at all.[/color]

That is literally true but irrelevant.

The main concerns only the C standard. You think the C standard is off-topic
in [clc]? That something else is also mentioned is irrelevant for topicality.

See <url: http://www.nizkor.org/features/fallacies/red-herring.html> and
<url: http://www.nizkor.org/features/fallacies/straw-man.html> (good
idea to study the other fallacies, too :-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
infobahn
Guest
 
Posts: n/a
#22: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Mark McIntyre wrote:[color=blue]
>
> On Sat, 5 Feb 2005 20:30:18 +0000 (UTC), in comp.lang.c , infobahn
> <infobahn@btinternet.com> wrote:
>[color=green]
> >Victor Bazarov wrote:[color=darkred]
> >>
> >> I wonder what _exactly_ does your copy say in 3.9.1/1 that makes you
> >> derive that 'char <= short <= int'. But that doesn't matter. You are
> >> actually correct, the C standard defined those relationships between
> >> type sizes.[/color]
> >
> >C&V please.[/color]
>
> 5.2.4.2.1 Sizes of Integral types.[/color]

That section talks about value ranges. Victor Barazov claimed that the
Standard defined those relationships between type *sizes*. That is, he
seemed to mean, for example, that sizeof(short) is guaranteed to be <=
sizeof(int). I can see nothing in 5.2.4.2.1 that requires this. Please
be more explicit. Thank you.
Mark McIntyre
Guest
 
Posts: n/a
#23: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Sun, 06 Feb 2005 14:19:58 GMT, in comp.lang.c , alfps@start.no (Alf P.
Steinbach) wrote:
[color=blue]
>Before posting such remarks, you might want to check up on my
>credentials, posting history etc.[/color]

I could do, but I wasn't the one making a fool of myself.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Mark McIntyre
Guest
 
Posts: n/a
#24: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Sun, 6 Feb 2005 16:10:19 +0000 (UTC), in comp.lang.c , infobahn
<infobahn@btinternet.com> wrote:
[color=blue]
>Mark McIntyre wrote:[color=green]
>>
>> 5.2.4.2.1 Sizes of Integral types.[/color]
>
>That section talks about value ranges.[/color]

Yes
[color=blue]
>Victor Barazov claimed that the
>Standard defined those relationships between type *sizes*.[/color]

Yes.
[color=blue]
>That is, he
>seemed to mean, for example, that sizeof(short) is guaranteed to be <=
>sizeof(int). I can see nothing in 5.2.4.2.1 that requires this. Please
>be more explicit. Thank you.[/color]

*shrug*. Only a pedant would argue about the difference. I know, CLC is
full of 'em. SIL.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Alf P. Steinbach
Guest
 
Posts: n/a
#25: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


* Mark McIntyre:[color=blue]
> * Alf P. Steinbach:[/color]

[reinserted][color=blue][color=green]
> > * Mark McIntyre:
> >[color=darkred]
> > > Before posting such remarks, you might want to check up on Jack's
> > > credentials, posting history etc.[/color][/color][/color]
[/reinserted][color=blue][color=green]
> >
> >Before posting such remarks, you might want to check up on my
> >credentials, posting history etc.[/color]
>
> I could do, but I wasn't the one making a fool of myself.[/color]

Don't engage in ad hominem attacks, don't misquote other people or quote them
out of context, follow your own advice, and you may become a happy person. :-)

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
infobahn
Guest
 
Posts: n/a
#26: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Mark McIntyre wrote:[color=blue]
>
> On Sun, 6 Feb 2005 16:10:19 +0000 (UTC), in comp.lang.c , infobahn
> <infobahn@btinternet.com> wrote:
>[color=green]
> >That is, he
> >seemed to mean, for example, that sizeof(short) is guaranteed to be <=
> >sizeof(int). I can see nothing in 5.2.4.2.1 that requires this. Please
> >be more explicit. Thank you.[/color]
>
> *shrug*. Only a pedant would argue about the difference. I know, CLC is
> full of 'em. SIL.[/color]

There's right, and there's wrong, and there's a grey area. The
original claim was slap bang in the middle of the "wrong", and
there's nothing "pedantic" about saying so. But, even if there
is, I'd rather be pedantic than wrong.
Julie
Guest
 
Posts: n/a
#27: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Mark McIntyre wrote:[color=blue]
> *shrug*. Only a pedant would argue about the difference. I know, CLC is
> full of 'em. SIL.[/color]

What is "SIL"?
Michael Mair
Guest
 
Posts: n/a
#28: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


Julie wrote:[color=blue]
> Mark McIntyre wrote:
>[color=green]
>> *shrug*. Only a pedant would argue about the difference. I know, CLC is
>> full of 'em. SIL.[/color]
>
> What is "SIL"?[/color]

Presumably, "such is life".


Cheers
Michael
--
E-Mail: Mine is a gmx dot de address.

Mark McIntyre
Guest
 
Posts: n/a
#29: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Tue, 08 Feb 2005 08:22:25 -0800, in comp.lang.c , Julie
<julie@nospam.com> wrote:
[color=blue]
>Mark McIntyre wrote:[color=green]
>> *shrug*. Only a pedant would argue about the difference. I know, CLC is
>> full of 'em. SIL.[/color]
>
>What is "SIL"?[/color]

Such Is Life.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Mark McIntyre
Guest
 
Posts: n/a
#30: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Tue, 08 Feb 2005 00:01:15 GMT, in comp.lang.c , alfps@start.no (Alf P.
Steinbach) wrote:
[color=blue]
>Don't engage in ad hominem attacks, don't misquote other people or quote them
>out of context,[/color]

I did none of these things, but you did. Physician, heal thyself.
[color=blue]
>follow your own advice, and you may become a happy person. :-)[/color]

I'm already happy thanks.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Dave Thompson
Guest
 
Posts: n/a
#31: Jul 23 '05

re: FAQ issue: Guaranteed value ranges of fundamental types?


On Tue, 08 Feb 2005 19:48:13 +0000, Mark McIntyre
<markmcintyre@spamcop.net> wrote:
[color=blue]
> On Tue, 08 Feb 2005 08:22:25 -0800, in comp.lang.c , Julie
> <julie@nospam.com> wrote:
>[color=green]
> >Mark McIntyre wrote:[color=darkred]
> >> *shrug*. Only a pedant would argue about the difference. I know, CLC is
> >> full of 'em. SIL.[/color]
> >
> >What is "SIL"?[/color]
>
> Such Is Life.[/color]

Perhaps ironically it is also System Implementation Language, the term
that was common around the time C was created for the category in
which it falls along with other languages that have more or less
fallen by the wayside like BLISS, PL/M, and the MODULAs.

- David.Thompson1 at worldnet.att.net
Closed Thread