473,549 Members | 2,366 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What Defins the "C" Language?

In Harbison and Steele's text (fourth edition, p.111)
it is stated,

The C language does not specify the range of integers that the
integral types will represent, except ot say that type int may not
be smaller than short and long may not be smaller than int.

They go on to say,

Many implementations represent characters in 8 bits, type short in
16 bits, and type long in 32 bits, with type int using either 16 or
32 bits depending on the implementation. ISO C requires
implementations to use at least these widths.

If the C language is not defined by ISO C, then what defines it?
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
ra*********@son yericsson.com, 919-472-1124
Nov 14 '05 #1
86 3864
"Randy Yates" <ra*********@so nyericsson.com> wrote in message
news:xx******** *****@usrts005. corpusers.net.. .
In Harbison and Steele's text (fourth edition, p.111)
it is stated,

The C language does not specify the range of integers that the
integral types will represent, except ot say that type int may not
be smaller than short and long may not be smaller than int.

They go on to say,

Many implementations represent characters in 8 bits, type short in
16 bits, and type long in 32 bits, with type int using either 16 or
32 bits depending on the implementation. ISO C requires
implementations to use at least these widths.

If the C language is not defined by ISO C, then what defines it?


There are requirements for conforming implementations , specified in ISO
standard documents, such as those you quote above. There is some leeway in
these requirements, as illustrated above, presumably to allow appropriate
choices to be made when creating an implementation for some specific
platform.

What is in the quotes that makes you think it is not defined by ISO C?

Alex
Nov 14 '05 #2
Alex Fraser wrote:
"Randy Yates" <ra*********@so nyericsson.com> wrote in message
news:xx******** *****@usrts005. corpusers.net.. .
In Harbison and Steele's text (fourth edition, p.111)
it is stated,

The C language does not specify the range of integers that the
integral types will represent, except ot say that type int may not
be smaller than short and long may not be smaller than int.

They go on to say,

Many implementations represent characters in 8 bits, type short in
16 bits, and type long in 32 bits, with type int using either 16 or
32 bits depending on the implementation. ISO C requires
implementations to use at least these widths.

If the C language is not defined by ISO C, then what defines it?

There are requirements for conforming implementations , specified in ISO
standard documents, such as those you quote above. There is some leeway in
these requirements, as illustrated above, presumably to allow appropriate
choices to be made when creating an implementation for some specific
platform.

What is in the quotes that makes you think it is not defined by ISO C?

Looks to me like he's asking if ISO doesn't define this'n'that(int eger
sizes etc.) Who does for a given arch/compiler ?

--
Nils O. Selåsdal
www.utelsystems.com
Nov 14 '05 #3
"Nils O. Selåsdal" <NO*@Utel.no> writes:
Alex Fraser wrote:
"Randy Yates" <ra*********@so nyericsson.com> wrote in message
news:xx******** *****@usrts005. corpusers.net.. .

In Harbison and Steele's text (fourth edition, p.111)
it is stated,

The C language does not specify the range of integers that the
integral types will represent, except ot say that type int may not
be smaller than short and long may not be smaller than int.

They go on to say,

Many implementations represent characters in 8 bits, type short in
16 bits, and type long in 32 bits, with type int using either 16 or
32 bits depending on the implementation. ISO C requires
implementations to use at least these widths.

If the C language is not defined by ISO C, then what defines it?

There are requirements for conforming implementations , specified in
ISO

standard documents, such as those you quote above. There is some leeway in
these requirements, as illustrated above, presumably to allow appropriate
choices to be made when creating an implementation for some specific
platform.
What is in the quotes that makes you think it is not defined by ISO
C?


Looks to me like he's asking if ISO doesn't define this'n'that(int eger
sizes etc.) Who does for a given arch/compiler ?


Prexactly. :)

I seem to recall conversations in years past of old machines that
had strange integer sizes (9 bits?) which C would support. Am I
delusional?
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
ra*********@son yericsson.com, 919-472-1124
Nov 14 '05 #4
"Randy Yates"
"Nils O. Selåsdal" <NO*@Utel.no>
Alex Fraser wrote:
> "Randy Yates"
>In Harbison and Steele's text (fourth edition, p.111) [implementation of integer stuff] What is in the quotes that makes you think it is not defined by ISO
C?


Looks to me like he's asking if ISO doesn't define this'n'that(int eger
sizes etc.) Who does for a given arch/compiler ?


Prexactly. :)

I seem to recall conversations in years past of old machines that
had strange integer sizes (9 bits?) which C would support. Am I
delusional?


You are delusional if you think that the assiduous study of H&S won't reveal
a rich, flexible language that uses the ANSI/ISO standard as a bulwark. MPJ
Nov 14 '05 #5
Merrill & Michele wrote:
"Randy Yates"
"Nils O. Selåsdal" <NO*@Utel.no>

Alex Fraser wrote:

>"Randy Yates"
>In Harbison and Steele's text (fourth edition, p.111)
[implementation of integer stuff]
What is in the quotes that makes you think it is not defined by ISO
C?

Looks to me like he's asking if ISO doesn't define this'n'that(int eger
sizes etc.) Who does for a given arch/compiler ?
Prexactly. :)

I seem to recall conversations in years past of old machines that
had strange integer sizes (9 bits?) which C would support. Am I
delusional?


The standard demands CHAR_BIT>=8 which gives you no problem with
9-bit-bytes. Furthermore, the effective range of signed int/unsigned int
according to the standard is that of a 16 bit number (but for INT_MIN),
so sizeof(int)*CHA R_BIT==18 (or 32, nowadays) gives you no problem,
either. The same for 36-bit-longs.
IMO, H&S have that right. Or did I misunderstand your question, too?

BTW: The good old machines with 6 bits to a byte probably do not
have any C implementations to speak of (... I wait to be contradicted).
You are delusional if you think that the assiduous study of H&S won't reveal
a rich, flexible language that uses the ANSI/ISO standard as a bulwark. MPJ


Your point was... ? Do you want to encourage/contradict/... the OP?
Cheers
Michael
--
E-Mail: Mine is an /at/ gmx /dot/ de address.
Nov 14 '05 #6
In article <xx************ *@usrts005.corp users.net>,
Randy Yates <ra*********@so nyericsson.com> wrote:
I seem to recall conversations in years past of old machines that
had strange integer sizes (9 bits?) which C would support. Am I
delusional?


Nine bits are not enough for the required ranges of integer types
such as short, int and long. It is, however, a perfectly valid
size for a byte, i.e. a char, unsigend char or signed char, in C.
A nine bit byte is only a strange size for people that view the
world through a PC.

--
Göran Larsson http://www.mitt-eget.com/
Nov 14 '05 #7
ho*@invalid.inv alid (Goran Larsson) writes:
In article <xx************ *@usrts005.corp users.net>,
Randy Yates <ra*********@so nyericsson.com> wrote:
I seem to recall conversations in years past of old machines that
had strange integer sizes (9 bits?) which C would support. Am I
delusional?


Nine bits are not enough for the required ranges of integer types
such as short, int and long.


What ranges are those? Where are they specified? This statement contradicts
H&S: "The C language does not specify the range of integers that the
integral types will represent...".
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
ra*********@son yericsson.com, 919-472-1124
Nov 14 '05 #8

"Randy Yates" <ra*********@so nyericsson.com> wrote in message
news:xx******** *****@usrts005. corpusers.net.. .
"Nils O. Selåsdal" <NO*@Utel.no> writes: Prexactly. :)

I seem to recall conversations in years past of old machines that
had strange integer sizes (9 bits?) which C would support. Am I
delusional?
Back in the Bad Old Days (tm) of bitslicers any number of bits was posible.
I recall a conversation with an "old pro" who told me about 47-bits
computers.
--
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
ra*********@son yericsson.com, 919-472-1124

Nov 14 '05 #9
"Michael Mair"
Merrill & Michele wrote:
"Randy Yates"
"Nils O. Selåsdal" <NO*@Utel.no>

>Alex Fraser wrote:
>
>>"Randy Yates"
>>In Harbison and Steele's text (fourth edition, p.111)
[implementation of integer stuff]
>What is in the quotes that makes you think it is not defined by ISO
>C?

Looks to me like he's asking if ISO doesn't define this'n'that(int eger
sizes etc.) Who does for a given arch/compiler ?

Prexactly. :)

I seem to recall conversations in years past of old machines that
had strange integer sizes (9 bits?) which C would support. Am I
delusional?
The standard demands CHAR_BIT>=8 which gives you no problem with
9-bit-bytes. Furthermore, the effective range of signed int/unsigned int
according to the standard is that of a 16 bit number (but for INT_MIN),
so sizeof(int)*CHA R_BIT==18 (or 32, nowadays) gives you no problem,
either. The same for 36-bit-longs.
IMO, H&S have that right. Or did I misunderstand your question, too?

BTW: The good old machines with 6 bits to a byte probably do not
have any C implementations to speak of (... I wait to be contradicted).
You are delusional if you think that the assiduous study of H&S won't

reveal a rich, flexible language that uses the ANSI/ISO standard as a bulwark.

MPJ
Your point was... ? Do you want to encourage/contradict/... the OP?


The sentence stands by itself. The OP had internal contradiction. Motives
are OT. MPJ
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3674
by: ross | last post by:
I want to do some tricky text file manipulation on many files, but have only a little programming knowledge. What are the ideal languages for the following examples? 1. Starting from a certain folder, look in the subfolders for all filenames matching *FOOD*.txt Any files matching in each folder should be copied to a new subfolder within...
8
4016
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ; Intermediate/Advanced Database designer . Because of the requirements , I must create Web Application . Access Pages is not suitable for that so I...
2
2338
by: thatisvaliant | last post by:
is it possible to determine what language an exe was created in? for example, i am interested in know what language onenote.exe and infopath.exe are written in.
13
7749
by: Sam Sungshik Kong | last post by:
Hi! This might be a stupid question. With what language was C# compiler created? I guess assembly. Or C? I am just curious. Sam
11
4027
by: Van Nastring | last post by:
I believe it is c++ right? Why don't they use c#?
5
1985
by: gerryR | last post by:
Not sure where to post this as I don't know what language it applies to (yet) Basically I work in IT and often have to manipulate folder structures or large amounts of text files and am looking for the best way of automating this procedure specifically through a programming language. I did Pascal, and C++ in college (several years ago now)...
2
4482
by: DR | last post by:
how to determine what language a c# string is written in? is there any C# method to take a string and return what language it is in? e.g. english, hindi, spanish, etc.
1
2156
by: DR | last post by:
how to determine what language a string is written in? is there any method to take a string and return what language it is in? e.g. english, hindi, spanish, etc.
5
2086
by: fscopel | last post by:
The eternal question... What language should I dedicate the beginning/most of my career to? It seems pretty obvious that most programmers can code in more than one language, but they are more fluent in one than the other. I have some knowledge in VB .Net but I am just starting. This is a very general question so I’ll make it very specific,...
5
1576
by: Larry__Weiss | last post by:
Can a C# program find out what language an assembly (or components thereof) is written in? - Larry
0
7546
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7985
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7830
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5387
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5111
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3496
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.