473,382 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

ULONG_LONG_MAX and gcc 3.4.1

The header file limits.h contains the following:

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* Minimum and maximum values a `signed long long int' can hold. */
# undef LLONG_MIN
# define LLONG_MIN (-LLONG_MAX - 1LL)
# undef LLONG_MAX
# define LLONG_MAX __LONG_LONG_MAX__

/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
# undef ULLONG_MAX
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
#endif

#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined
(__STRICT_ANSI__)
/* Minimum and maximum values a `signed long long int' can hold. */
# undef LONG_LONG_MIN
# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
# undef LONG_LONG_MAX
# define LONG_LONG_MAX __LONG_LONG_MAX__

/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
# undef ULONG_LONG_MAX
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
#endif

When I include this in my programs the LONG LONG type definitions aren't
available, so I gather either or both of the #ifdef conditions
(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

are not met. I am on a Gentoo Linux box, 2.6.17 kernel, using gcc 3.41
I haven't been able to find out how to get these conditions evaluate to
be true. Is it a gcc setting, inclusion of another header file, or
something else ?

Thanks
Sh.
Aug 5 '06 #1
2 5538
Schraalhans Keukenmeester wrote:
The header file limits.h contains the following:

#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
/* Minimum and maximum values a `signed long long int' can hold. */
# undef LLONG_MIN
# define LLONG_MIN (-LLONG_MAX - 1LL)
# undef LLONG_MAX
# define LLONG_MAX __LONG_LONG_MAX__

/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
# undef ULLONG_MAX
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
#endif
Note: ULLONG_MAX.
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined
(__STRICT_ANSI__)
/* Minimum and maximum values a `signed long long int' can hold. */
# undef LONG_LONG_MIN
# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
# undef LONG_LONG_MAX
# define LONG_LONG_MAX __LONG_LONG_MAX__

/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
# undef ULONG_LONG_MAX
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
#endif
Note: ULONG_LONG_MAX.
When I include this in my programs the LONG LONG type definitions aren't
available, so I gather either or both of the #ifdef conditions
(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

are not met. I am on a Gentoo Linux box, 2.6.17 kernel, using gcc 3.41
I haven't been able to find out how to get these conditions evaluate to
be true. Is it a gcc setting, inclusion of another header file, or
something else ?
Try gnu.gcc for all your GCC questions.

The short answer is to use ULLONG_MAX, which is covered by the standard.
ULONG_LONG_MAX is nonstandard and will not appear in <limits.hif GCC is
invoked in compliant mode.

S.
Aug 5 '06 #2
On Sat, 05 Aug 2006 18:48:00 +0200, in comp.lang.c , Schraalhans
Keukenmeester <fi********************@xsfourall.ennelwrote:
>The header file limits.h contains the following:
(snip some conditional code)
>
When I include this in my programs the LONG LONG type definitions aren't
available, so I gather either or both of the #ifdef conditions
(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L

are not met. I am on a Gentoo Linux box, 2.6.17 kernel, using gcc 3.41
I haven't been able to find out how to get these conditions evaluate to
be true. Is it a gcc setting, inclusion of another header file, or
something else ?
This is a GCC question, and you should ask in a gcc group or RTFM.
Consider also the effect of commandline options to gcc.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
Aug 14 '06 #3

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

Similar topics

5
by: drj0nson | last post by:
Without getting too mathematical : how do you print/handle big numbers? for ( int i = 1 ; i < 10 ; i ++) cout << (123456789 << i) << endl; 246913578 493827156 987654312 1975308624...
5
by: Mark Shelor | last post by:
Problem: find a portable way to determine whether a compiler supports the "long long" type of C99. I thought I had this one solved with the following code: #include <limits.h> #ifdef...
13
by: Ioannis Vranos | last post by:
Hi all, Is long long supposed to be supported in all C99 implementations?If yes is it supposed to be 64 bit at least? GCC says that it supports long long, but i got this: #include <stdio.h>...
3
by: massdeletion101 | last post by:
I need help, and when I ask for it around here, it usually goes with little or no replies and help watsoever. It seems the only way to get the message across is to make the title desperate sounding....
10
by: massdeletion101 | last post by:
Is there anyway to assign a value of type string to be the name of an integer, or convert the value or vise versa? Example: int Q = 1; string member = "member" + Q; //some kind of type name or...
26
by: kerravon | last post by:
The following C program: int main(void) { int x = -2147483648; return (0); } Produces the following warning:
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.