473,804 Members | 3,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

long long extended type in c89?

j
Sadly, I don't have a copy of the c89 standard, just a copy of the c99
standard. I was curious if in c89, the type ``long long'' is indeed
considered an extended type that may or may not be implemented by the
implementation? And if it states whether or not the size of ``long
long'' is equal to the size of ``long'' or can be greater than the
size there-of?
Nov 13 '05 #1
4 5711
Jack Klein <ja*******@spam cop.net> wrote:
On 23 Aug 2003 15:54:02 -0700, ja****@bellsout h.net (j) wrote in
comp.lang.c:
Sadly, I don't have a copy of the c89 standard, just a copy of the c99
standard. I was curious if in c89, the type ``long long'' is indeed
considered an extended type that may or may not be implemented by the
implementation? And if it states whether or not the size of ``long
long'' is equal to the size of ``long'' or can be greater than the
size there-of?


The original C standard, as well as the C99 standard, allow a
conforming implementation to provide extensions as long as they do not
impact any strictly conforming program.

Using the keyword long twice within one declaration is an error in a
pre-C99 keyword, so an implementation is free to provide a type named
"long long" as an extension. Since it is completely an extension, it
can be anything at all that the implementation wants it to be.


I believe, as a syntax error, that it must be diagnosed.

- Kevin.

Nov 13 '05 #2
j
Jack Klein <ja*******@spam cop.net> wrote in message news:<fr******* *************** **********@4ax. com>...
On 23 Aug 2003 15:54:02 -0700, ja****@bellsout h.net (j) wrote in
comp.lang.c:
Sadly, I don't have a copy of the c89 standard, just a copy of the c99
standard. I was curious if in c89, the type ``long long'' is indeed
considered an extended type that may or may not be implemented by the
implementation? And if it states whether or not the size of ``long
long'' is equal to the size of ``long'' or can be greater than the
size there-of?


The original C standard, as well as the C99 standard, allow a
conforming implementation to provide extensions as long as they do not
impact any strictly conforming program.

Using the keyword long twice within one declaration is an error in a
pre-C99 keyword, so an implementation is free to provide a type named
"long long" as an extension. Since it is completely an extension, it
can be anything at all that the implementation wants it to be.

Prior to C99, there was a DR that stated that no standard integer type
could be "longer" than long, i.e., size_t, ptrdiff_t, and so on. But
a "long long" type in a pre-C99 compiler would be an extension, not a
standard type, and the only limitation placed on extensions is the one
above.

That is what I was looking for. Thanks Jack. :)
Nov 13 '05 #3
On Sun, 24 Aug 2003 11:34:25 GMT, Kevin Easton
<kevin@-nospam-pcug.org.au> wrote in comp.lang.c:
Jack Klein <ja*******@spam cop.net> wrote:
On 23 Aug 2003 15:54:02 -0700, ja****@bellsout h.net (j) wrote in
comp.lang.c:
Sadly, I don't have a copy of the c89 standard, just a copy of the c99
standard. I was curious if in c89, the type ``long long'' is indeed
considered an extended type that may or may not be implemented by the
implementation? And if it states whether or not the size of ``long
long'' is equal to the size of ``long'' or can be greater than the
size there-of?


The original C standard, as well as the C99 standard, allow a
conforming implementation to provide extensions as long as they do not
impact any strictly conforming program.

Using the keyword long twice within one declaration is an error in a
pre-C99 keyword, so an implementation is free to provide a type named
"long long" as an extension. Since it is completely an extension, it
can be anything at all that the implementation wants it to be.


I believe, as a syntax error, that it must be diagnosed.

- Kevin.


Look at paragraphs 4 and 5 of Section 4 (C99):

"A strictly conforming program shall use only those features of the
language and library specified in this International Standard."

---and---

"A conforming implementation may have extensions (including additional
library functions), provided they do not alter the behavior of any
strictly conforming program."

I would say that a program containing a syntax error is *NOT* a
strictly conforming program (first quotation). Therefore a conforming
implementation is free to make an extension out of something that
would otherwise be a syntax error.

--
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.l earn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Nov 13 '05 #4
Jack Klein <ja*******@spam cop.net> wrote:
On Sun, 24 Aug 2003 11:34:25 GMT, Kevin Easton
<kevin@-nospam-pcug.org.au> wrote in comp.lang.c:
Jack Klein <ja*******@spam cop.net> wrote:
> On 23 Aug 2003 15:54:02 -0700, ja****@bellsout h.net (j) wrote in
> comp.lang.c:
>
>> Sadly, I don't have a copy of the c89 standard, just a copy of the c99
>> standard. I was curious if in c89, the type ``long long'' is indeed
>> considered an extended type that may or may not be implemented by the
>> implementation? And if it states whether or not the size of ``long
>> long'' is equal to the size of ``long'' or can be greater than the
>> size there-of?
>
> The original C standard, as well as the C99 standard, allow a
> conforming implementation to provide extensions as long as they do not
> impact any strictly conforming program.
>
> Using the keyword long twice within one declaration is an error in a
> pre-C99 keyword, so an implementation is free to provide a type named
> "long long" as an extension. Since it is completely an extension, it
> can be anything at all that the implementation wants it to be.


I believe, as a syntax error, that it must be diagnosed.

- Kevin.


Look at paragraphs 4 and 5 of Section 4 (C99):

"A strictly conforming program shall use only those features of the
language and library specified in this International Standard."

---and---

"A conforming implementation may have extensions (including additional
library functions), provided they do not alter the behavior of any
strictly conforming program."

I would say that a program containing a syntax error is *NOT* a
strictly conforming program (first quotation). Therefore a conforming
implementation is free to make an extension out of something that
would otherwise be a syntax error.


I point you to Section 5 (I'm quoting here from N869):

5.1.1.3 Diagnostics
1 A conforming implementation shall produce at least one diagnostic
message (identified in an implementation-defined manner) if a
preprocessing translation unit or translation unit contains a violation
of any syntax rule or constraint, even if the behavior is also
explicitly specified as undefined or implementation-defined. Diagnostic
messages need not be produced in other circumstances.

(So an implementation can indeed provide a long long type, but it has to
say something like "Warning: You used the long long type!").

- Kevin.
Nov 13 '05 #5

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

Similar topics

3
17854
by: S.Susnjar | last post by:
Hello all, I have been programming in Python only for a month or so and have stumbled over a "problem" that I could not solve through rtfm. $ python Python 2.2.2 (#1, Nov 6 2003, 09:19:47) on irix646 Type "help", "copyright", "credits" or "license" for more information. >>> ulong_max=18446744073709551615
1
1739
by: dan | last post by:
Can someone tell me the difference between these three data types? Thanks Daniel
32
22645
by: f | last post by:
I have this double sum, a, b, c; sum = a + b + c; printf("%.20f = %.20f, %.20f, %.20f", sum, a, b, c); I found that the debug version and release version of the same code give me different result. I am using VC++ 6.0. In debug version, the print out is:
88
6038
by: Matt | last post by:
Hi folks. Can you help with some questions? I gather that some types supported by g++ are nonstandard but have been proposed as standards. Are the long long and unsigned long long types still under consideration for the ANSI C and C++ standards? Are they likely to be accepted into the standards? Which compilers support those types, and which do not?
2
3795
by: Bryan Olson | last post by:
The current Python standard library provides two cryptographic hash functions: MD5 and SHA-1 . The authors of MD5 originally stated: It is conjectured that it is computationally infeasible to produce two messages having the same message digest. That conjecture is false, as demonstrated by Wang, Feng, Lai and Yu in 2004 . Just recently, Wang, Yu, and Lin showed a short- cut solution for finding collisions in SHA-1 . Their result
13
2263
by: Ian Tuomi | last post by:
Hello. I have been reading about all the different standards in C and I am quite confused, and have a few questions. () How is C99 "better" than older versions of C? (or is it?) What is the "official" C definition nowadays? C99? What standard does K&R 2nd edition describe? Where can I get a book that has the latest(or best) standard? What is the most used standard? What books should every C programmer have? (I allready have K&R 2)
10
18776
by: Bryan Parkoff | last post by:
The guideline says to use %f in printf() function using the keyword float and double. For example float a = 1.2345; double b = 5.166666667; printf("%.2f\n %f\n", a, b);
69
5606
by: fieldfallow | last post by:
Hello all, Before stating my question, I should mention that I'm fairly new to C. Now, I attempted a small demo that prints out the values of C's numeric types, both uninitialised and after assigning them their maximum defined values. However, the output of printf() for the long double 'ld' and the pointer of type void 'v_p', after initialisation don't seem to be right. The compiler used was gcc (mingw) with '-Wall', '-std=c99' and
0
2563
by: Charles Coldwell | last post by:
James Kanze <james.kanze@gmail.comwrites: True, with some additional considerations. The commonly used IEEE 754 floating point formats are single precision: 32 bits including 1 sign bit, 23 significand bits (with an implicit leading 1, for 24 total), and 8 exponent bits double precision: 64 bits including 1 sign bit, 52 significand bits
0
9587
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10588
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10340
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7623
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5662
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4302
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
2
3827
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.