By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,028 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,028 IT Pros & Developers. It's quick & easy.

who decides the size of a data type?

P: n/a
rao
On some of the compilers integer size is 2 and on some other it is 4
bytes.
My doubt is who decides the size of the integer?
is it plainly the compiler?
Does OS or Processor also has any control in deciding the size of such
data types?
Mar 16 '08 #1
Share this Question
Share on Google+
26 Replies


P: n/a
rao wrote:
) On some of the compilers integer size is 2 and on some other it is 4
) bytes.

And on some, it is 8. And on very few others, it's another number.

) My doubt is who decides the size of the integer?

In India, do 'doubt' and 'question' translate to the same word ?
In any case, the right word to use in English is 'question'.

) is it plainly the compiler?
) Does OS or Processor also has any control in deciding the size of such
) data types?

Usually, the compiler decides the size, based on what the OS and/or
the processor have to offer. I think the C standard even strongly
suggests that 'int' be the size that is 'most natural' to the system.

However, it is ultimately the compiler that makes the decision.
For example, there are systems that have 'natural' 8-byte integers,
but a lot of C compilers still use 4-byte int types.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
Mar 16 '08 #2

P: n/a
>On some of the compilers integer size is 2 and on some other it is 4
>bytes.
There are other possibilities. Don't be surprised to see 8 in the
future. And 3 isn't impossible.
>My doubt is who decides the size of the integer?
The compiler writer. But some choices make his job easier than others.
>is it plainly the compiler?
Does OS or Processor also has any control in deciding the size of such
data types?
The choice is heavily influenced by such things as the size of
machine registers, the instruction set of the machine, and the
interface the OS provides. It is possible, for example, to provide
an integer of size 3 (3 11-bit characters) on an Intel x86 machine,
but the code will not be very efficient and it may be wasteful of
storage. You can emulate one machine on another, and generate code
for the emulated machine, but that's a lot of effort and no guarantee
of efficiency.


Mar 16 '08 #3

P: n/a
rao wrote:
On some of the compilers integer size is 2 and on some other it is 4
bytes.
My doubt is who decides the size of the integer?
is it plainly the compiler?
Does OS or Processor also has any control in deciding the size of such
data types?
Generally both. Most compilers map C's numeric types to the underlying
hardware types in the most efficient manner possible. Usually the type
char is aliased to the machine's byte while the type int corresponds to
the native word of the processor. Other types may vary. Main concerns
for implementors are to avoid breaking existing code and to provide as
much efficiency as possible.

The Standard of course specifies the minimum ranges for these types
which every conforming compiler must adhere to.

Mar 16 '08 #4

P: n/a
On Mar 16, 8:31 pm, Willem <wil...@stack.nlwrote:
<snip>
In India, do 'doubt' and 'question' translate to the same word ?
In any case, the right word to use in English is 'question'.
When in doubt, we ask a question.
Mar 16 '08 #5

P: n/a
santosh wrote:
Usually the type char is aliased to the machine's
byte while the type int corresponds to the native word of the
processor.
Not to forget that some architectures provide special functions
to operate on strings, which have some constraints on the type
(like each element of a string being a byte of 8 bits). It makes
quite some sense if an C implementation uses this type then for
char.

Wolfgang Draxinger
--
E-Mail address works, Jabber: he******@jabber.org, ICQ: 134682867

Mar 16 '08 #6

P: n/a
Willem wrote:
rao wrote:
>On some of the compilers integer size is 2 and on some other it
is 4 bytes.

And on some, it is 8. And on very few others, it's another number.
>My doubt is who decides the size of the integer?

In India, do 'doubt' and 'question' translate to the same word ?
In any case, the right word to use in English is 'question'.
No, Willem. The phrases "I have a doubt" and "my doubt" are quite
ordinary English usage. They are more popular in India than in
most other English speaking areas. I concede that many native
English speakers don't recognize that, but their ignorance is of no
concern. You, apparantly, are Dutch, and have no reason to
recognize the usage.

At any rate, apply my favorite exorcism. Sedulously eschew
obfuscation. :-)

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

--
Posted via a free Usenet account from http://www.teranews.com

Mar 17 '08 #7

P: n/a
Willem <wi****@stack.nlwrites:
rao wrote:
[...]
) My doubt is who decides the size of the integer?

In India, do 'doubt' and 'question' translate to the same word ?
In any case, the right word to use in English is 'question'.
[...]

In Indian English, "doubt" is often used as a synonym for "question".
In dialects of English outside India, "doubt" has a connotation of
disbelief.

Non-Indian readers need to understand this. Indian posters should, I
suggest, try to use the word "question" rather than "doubt" when
posting in international forums like this one to avoid confusion.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 17 '08 #8

P: n/a
Keith Thompson said:

<snip>
In Indian English, "doubt" is often used as a synonym for "question".
In dialects of English outside India, "doubt" has a connotation of
disbelief.

Non-Indian readers need to understand this.
No. If non-Indian readers /do/ understand, it's a bonus, but it is *not* a
requirement. A seeker after (effective) help cannot get that help if he or
she does not make himself or herself understood. Thus, it is in the
seeker's interest to use English in the canonical way.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Mar 17 '08 #9

P: n/a
Richard Heathfield <rj*@see.sig.invalidwrote:
Keith Thompson said:
<snip>
In Indian English, "doubt" is often used as a synonym for "question".
In dialects of English outside India, "doubt" has a connotation of
disbelief.

Non-Indian readers need to understand this.
No. If non-Indian readers /do/ understand, it's a bonus, but it is *not* a
requirement. A seeker after (effective) help cannot get that help if he or
she does not make himself or herself understood. Thus, it is in the
seeker's interest to use English in the canonical way.
So, before a poster can seek help in mastering the C language, they should
first master Oxford English?

The OP's intended meaning was clear from the context, if not from a
reasonable interpretation of the word itself. This case is entirely
different from someone using l33t speak, which is intended to _exclude_
readers, and where it might be reasonable to take offence at the person's
presumed motivation or impoliteness.
Mar 17 '08 #10

P: n/a
Keith Thompson wrote:
Willem <wi****@stack.nlwrites:
>rao wrote:
[...]
>) My doubt is who decides the size of the integer?

In India, do 'doubt' and 'question' translate to the same word ?
In any case, the right word to use in English is 'question'.
[...]

In Indian English, "doubt" is often used as a synonym for "question".
In dialects of English outside India, "doubt" has a connotation of
disbelief.

Non-Indian readers need to understand this. Indian posters should, I
suggest, try to use the word "question" rather than "doubt" when
posting in international forums like this one to avoid confusion.
Who cares about oxford english?

This is an international forum. It is enough that we have to use
english instead of a commonly recognized international language
like latin, french or esperanto

:-)

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Mar 17 '08 #11

P: n/a
jacob navia wrote:
Keith Thompson wrote:
>Willem <wi****@stack.nlwrites:
>>rao wrote:
[...]
>>) My doubt is who decides the size of the integer?

In India, do 'doubt' and 'question' translate to the same word ?
In any case, the right word to use in English is 'question'.
[...]

In Indian English, "doubt" is often used as a synonym for "question".
In dialects of English outside India, "doubt" has a connotation of
disbelief.

Non-Indian readers need to understand this. Indian posters should, I
suggest, try to use the word "question" rather than "doubt" when
posting in international forums like this one to avoid confusion.

Who cares about oxford english?
The English inhabitants of Oxford?

--
Ian Collins.
Mar 17 '08 #12

P: n/a
jacob navia said:

<snip>
This is an international forum. It is enough that we have to use
english instead of a commonly recognized international language
like latin, french or esperanto

:-)
fr.comp.lang.c exists.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Mar 17 '08 #13

P: n/a
Ian Collins wrote:
jacob navia wrote:
>Who cares about oxford english?
The English inhabitants of Oxford?
They do not read comp.lang.c anyway.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Mar 17 '08 #14

P: n/a
jacob navia wrote:
Ian Collins wrote:
>jacob navia wrote:
>>Who cares about oxford english?
The English inhabitants of Oxford?
They do not read comp.lang.c anyway.
Why would my moving (back) to Oxford cause me to abandon this newsgroup?

--
"This instability seems a main source of its strength." /The Demon Breed/

Hewlett-Packard Limited Cain Road, Bracknell, registered no:
registered office: Berks RG12 1HN 690597 England

Mar 17 '08 #15

P: n/a
On Mar 16, 11:11*pm, CBFalconer <cbfalco...@yahoo.comwrote:
No, Willem. *The phrases "I have a doubt" and "my doubt" are quite
ordinary English usage. *They are more popular in India than in
most other English speaking areas. *I concede that many native
English speakers don't recognize that, but their ignorance is of no
concern. *
You are contradicting yourself here. If many native English speakers
don't recognise a phrase, then it is by definition not ordinary
English usage.

("I have a doubt" is of course an ordinary English sentence, but it
means something completely different from "I have a question").

But no matter what, if anyone has a question then they should write "I
have a question" and chances are much better that they will get an
answer instead of a lengthy thread about proper use of the English
language.
Mar 20 '08 #16

P: n/a
christian.bau wrote:
On Mar 16, 11:11 pm, CBFalconer <cbfalco...@yahoo.comwrote:
>No, Willem. The phrases "I have a doubt" and "my doubt" are quite
ordinary English usage. They are more popular in India than in
most other English speaking areas. I concede that many native
English speakers don't recognize that, but their ignorance is of no
concern.

You are contradicting yourself here. If many native English speakers
don't recognise a phrase, then it is by definition not ordinary
English usage.
[snip english grammar discussion]

So, speaking about debuggers and what happens when a program
crash is off topic for mr Bau. Obviously, discussing
english grammar is not.

This is an example of the double standards that the regulars
use:

If I discuss english grammar is ON TOPIC in c.l.c

If Jacob discusses debuggers and debugging that is OFF TOPIC
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Mar 20 '08 #17

P: n/a
jacob navia <ja***@nospam.comwrites:
christian.bau wrote:
>On Mar 16, 11:11 pm, CBFalconer <cbfalco...@yahoo.comwrote:
>>No, Willem. The phrases "I have a doubt" and "my doubt" are quite
ordinary English usage. They are more popular in India than in
most other English speaking areas. I concede that many native
English speakers don't recognize that, but their ignorance is of no
concern.

You are contradicting yourself here. If many native English speakers
don't recognise a phrase, then it is by definition not ordinary
English usage.

[snip english grammar discussion]

So, speaking about debuggers and what happens when a program
crash is off topic for mr Bau. Obviously, discussing
english grammar is not.

This is an example of the double standards that the regulars
use:

If I discuss english grammar is ON TOPIC in c.l.c

If Jacob discusses debuggers and debugging that is OFF TOPIC
Mr Bau has clearly demonstrated which side of common sense he is on.
Mar 20 '08 #18

P: n/a
"christian.bau" wrote:
CBFalconer <cbfalco...@yahoo.comwrote:
>No, Willem. The phrases "I have a doubt" and "my doubt" are
quite ordinary English usage. They are more popular in India
than in most other English speaking areas. I concede that many
native English speakers don't recognize that, but their
ignorance is of no concern.

You are contradicting yourself here. If many native English
speakers don't recognise a phrase, then it is by definition not
ordinary English usage.

("I have a doubt" is of course an ordinary English sentence,
but it means something completely different from "I have a
question").
True. It means the originator 'has a doubt' about something or
other. It may be clearable by asking a question, deepening an
explanation, etc. It doesn't mean "I have a question". It does
express a lack of understanding. These are just simple English
words, placed in sequence, to express something. Not even
idiomatic.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

--
Posted via a free Usenet account from http://www.teranews.com

Mar 20 '08 #19

P: n/a
jacob navia wrote:
christian.bau wrote:
>CBFalconer <cbfalco...@yahoo.comwrote:
>>No, Willem. The phrases "I have a doubt" and "my doubt" are
quite ordinary English usage. They are more popular in India
than in most other English speaking areas. I concede that
many native English speakers don't recognize that, but their
ignorance is of no concern.

You are contradicting yourself here. If many native English
speakers don't recognise a phrase, then it is by definition not
ordinary English usage.

[snip english grammar discussion]

So, speaking about debuggers and what happens when a program crash
is off topic for mr Bau. Obviously, discussing english grammar is
not. This is an example of the double standards that the regulars
use: If I discuss english grammar is ON TOPIC in c.l.c. If Jacob
discusses debuggers and debugging that is OFF TOPIC
Well, I let this sit for almost 24 hours before replying. This is
another horrible example of Navias irritation tactics. It would be
quite sufficient to post a short reply saying something like "I
consider this off-topic", and see what response is generated.
Instead he immediately draws back a fist and smashes all nearby in
the nose(s). Note the generic use of 'regulars' to denote any user
that ever expressed disagreement with Navia.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

--
Posted via a free Usenet account from http://www.teranews.com

Mar 21 '08 #20

P: n/a
CBFalconer <cb********@yahoo.comwrites:
"christian.bau" wrote:
>CBFalconer <cbfalco...@yahoo.comwrote:
>>No, Willem. The phrases "I have a doubt" and "my doubt" are
quite ordinary English usage. They are more popular in India
than in most other English speaking areas. I concede that many
native English speakers don't recognize that, but their
ignorance is of no concern.

You are contradicting yourself here. If many native English
speakers don't recognise a phrase, then it is by definition not
ordinary English usage.

("I have a doubt" is of course an ordinary English sentence,
but it means something completely different from "I have a
question").

True. It means the originator 'has a doubt' about something or
other. It may be clearable by asking a question, deepening an
explanation, etc. It doesn't mean "I have a question". It does
express a lack of understanding. These are just simple English
words, placed in sequence, to express something. Not even
idiomatic.
The point I think you're missing is that in the Indian dialect of
English, the word "doubt" apparently *is* commonly used to mean
"question".

I won't debate whether this usage is correct, but it wouldn't hurt for
readers of this newsgroup to be aware that it exists. (It's hard to
see how a regular reader could avoid being aware of it, since it's
been discussed here numerous times.)

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 21 '08 #21

P: n/a
Keith Thompson said:

<snip>
>
The point I think you're missing is that in the Indian dialect of
English, the word "doubt" apparently *is* commonly used to mean
"question".
The point I think /you're/ missing is that we are constantly enjoined to be
generous in what we accept, but strict in what we produce. And we try to
be. But it would sure be good if some *other people* tried doing the same
thing.

Programmers are supposed to be amongst the brightest people on the planet.
They should be able to *learn*. When people show an inability or
unwillingness to learn, that doesn't bode well for their future career as
a programmer.
I won't debate whether this usage is correct, but it wouldn't hurt for
readers of this newsgroup to be aware that it exists.
Agreed, but it also wouldn't hurt for writers to this newsgroup to read the
group for a while before posting, and learn how to use the word
'question'.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Mar 21 '08 #22

P: n/a
Keith Thompson <ks***@mib.orgwrote:
CBFalconer <cb********@yahoo.comwrites:
"christian.bau" wrote:
("I have a doubt" is of course an ordinary English sentence,
but it means something completely different from "I have a
question").
True. It means the originator 'has a doubt' about something or
other. It may be clearable by asking a question, deepening an
explanation, etc. It doesn't mean "I have a question". It does
express a lack of understanding. These are just simple English
words, placed in sequence, to express something. Not even
idiomatic.

The point I think you're missing is that in the Indian dialect of
English, the word "doubt" apparently *is* commonly used to mean
"question".
Whereas I'm (un?)reliably informed that in the London dialect, "bare" is
used to mean "very", and "cheers" means "thank you". Shall we adopt
those, as well, on this barely legible newsgroup?

Richard
Mar 21 '08 #23

P: n/a
Richard Heathfield wrote:
Keith Thompson said:

<snip>
>The point I think you're missing is that in the Indian dialect of
English, the word "doubt" apparently *is* commonly used to mean
"question".

The point I think /you're/ missing is that we are constantly enjoined to be
generous in what we accept, but strict in what we produce. And we try to
be. But it would sure be good if some *other people* tried doing the same
thing.

Programmers are supposed to be amongst the brightest people on the planet.
They should be able to *learn*. When people show an inability or
unwillingness to learn, that doesn't bode well for their future career as
a programmer.
>I won't debate whether this usage is correct, but it wouldn't hurt for
readers of this newsgroup to be aware that it exists.

Agreed, but it also wouldn't hurt for writers to this newsgroup to read the
group for a while before posting, and learn how to use the word
'question'.
I believe you're much too strict. 'Correct' English is determined by
usage. Americans and Australians can use English somewhat differently
than Britains but just as correctly. So Indians.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Mar 21 '08 #24

P: n/a
Richard Heathfield <rj*@see.sig.invalidwrites:
Keith Thompson said:

<snip>
>>
The point I think you're missing is that in the Indian dialect of
English, the word "doubt" apparently *is* commonly used to mean
"question".

The point I think /you're/ missing is that we are constantly enjoined to be
generous in what we accept, but strict in what we produce. And we try to
be. But it would sure be good if some *other people* tried doing the same
thing.

Programmers are supposed to be amongst the brightest people on the planet.
They should be able to *learn*. When people show an inability or
unwillingness to learn, that doesn't bode well for their future career as
a programmer.
>I won't debate whether this usage is correct, but it wouldn't hurt for
readers of this newsgroup to be aware that it exists.

Agreed, but it also wouldn't hurt for writers to this newsgroup to read the
group for a while before posting, and learn how to use the word
'question'.
I'm not sure why you say I'm missing that point, when I made it in
this very thread 5 days ago:
| In Indian English, "doubt" is often used as a synonym for "question".
| In dialects of English outside India, "doubt" has a connotation of
| disbelief.
|
| Non-Indian readers need to understand this. Indian posters should, I
| suggest, try to use the word "question" rather than "doubt" when
| posting in international forums like this one to avoid confusion.

I didn't reiterate the second part because it wasn't relevant to what
I was responding to.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 21 '08 #25

P: n/a
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
Keith Thompson <ks***@mib.orgwrote:
>CBFalconer <cb********@yahoo.comwrites:
"christian.bau" wrote:
("I have a doubt" is of course an ordinary English sentence,
but it means something completely different from "I have a
question").

True. It means the originator 'has a doubt' about something or
other. It may be clearable by asking a question, deepening an
explanation, etc. It doesn't mean "I have a question". It does
express a lack of understanding. These are just simple English
words, placed in sequence, to express something. Not even
idiomatic.

The point I think you're missing is that in the Indian dialect of
English, the word "doubt" apparently *is* commonly used to mean
"question".

Whereas I'm (un?)reliably informed that in the London dialect, "bare" is
used to mean "very", and "cheers" means "thank you". Shall we adopt
those, as well, on this barely legible newsgroup?
I'd be very interested in seeing a citation of an article in which I
suggested something even vaguely similar to that.

I was merely making an observation, and I've already suggested that
Indian posters should consider avoiding the use of "doubt" as a
synonym for "question" when posting here.

--
Keith Thompson (The_Other_Keith) <ks***@mib.org>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Mar 21 '08 #26

P: n/a
Keith Thompson wrote, On 21/03/08 16:12:
rl*@hoekstra-uitgeverij.nl (Richard Bos) writes:
>Keith Thompson <ks***@mib.orgwrote:
>>CBFalconer <cb********@yahoo.comwrites:
"christian.bau" wrote:
("I have a doubt" is of course an ordinary English sentence,
but it means something completely different from "I have a
question").
True. It means the originator 'has a doubt' about something or
other. It may be clearable by asking a question, deepening an
explanation, etc. It doesn't mean "I have a question". It does
express a lack of understanding. These are just simple English
words, placed in sequence, to express something. Not even
idiomatic.
The point I think you're missing is that in the Indian dialect of
English, the word "doubt" apparently *is* commonly used to mean
"question".
Whereas I'm (un?)reliably informed that in the London dialect, "bare" is
used to mean "very", and "cheers" means "thank you". Shall we adopt
those, as well, on this barely legible newsgroup?

I'd be very interested in seeing a citation of an article in which I
suggested something even vaguely similar to that.
Well, I can state that outside London (I live a little outside London)
"cheers" is often used to mean "thank you", to me it is idiomatic
English. I have not come across "bare" being used as "very".
I was merely making an observation, and I've already suggested that
Indian posters should consider avoiding the use of "doubt" as a
synonym for "question" when posting here.
I agree.

My opinion is people shout NOT post *just* to point out non-standard
English from a non-native English speaker. However, if posting a
response for other reasons there is nothing wrong with politely pointing
out that it is non-standard English.
--
Flash Gordon
Mar 21 '08 #27

This discussion thread is closed

Replies have been disabled for this discussion.