Mathieu Malaterre wrote:
Hello,
Can anyone confirm which one is which: it seems that ULLONG_MAX is
only c99, whereas LLONG_MAX is c89. It doesn't make much sense since I
would expect both would be defined *or* none of them.
Thanks for confirmation
Mathieu
D:\>type longlongint.c
#include <stdlib.h>
int main() {
long long int a;
unsigned long long int b;
return EXIT_SUCCESS;
}
D:\>gcc -Wall -ansi -pedantic longlongint.c
longlongint.c: In function `main':
longlongint.c:4: warning: ISO C90 does not support `long long'
longlongint.c:5: warning: ISO C90 does not support `long
long' longlongint.c:4: warning: unused variable `a'
longlongint.c:5: warning: unused variable
`b'
In c99 standard, 5.2.4.2.1 Size of integer limits ,
"
— maximum value for an object of type long long int
LLONG_MAX +9223372036854775807 // 2^63 - 1
— maximum value for an object of type unsigned long long int
ULLONG_MAX 18446744073709551615 // 2^64 - 1
"
So since those types are not defined in c89, the two macros could not
have been defined in c89 either.
--
Karthik.
http://akktech.blogspot.com .
' Remove _nospamplz from my email to mail me. '