Mail Archives: djgpp/1997/09/10/01:04:20
On 10 Sep 97 at 2:54, M. Schulter wrote:
> Hi, there.
>
> Looking at the GCC docs and reading the mail archives on DJ's site
> leaves me still a bit unclear as to whether DJGPP supports the
> 64-bit long long int type.
DJGPP definitly does support `long long'.
> The following program suggests either that indeed this type is not
> supported on DJGPP, or that I've goofed <grin>.
>
> #include <stdio.h>
> int main(void)
> {
> long long int _n0 = 1222333444555LL;
> printf("\n\nNow _n0 = %lli.\n\n",_n0);
Use `%Ld' instead (I used `%Lx')
> return(0);
> }
>
> Interestingly, although I wasn't able to find mention of a printf()
> format specifier for this type, either %lld or %lli (a guess)
> provokes no complaints from GCC -- but yields a result suggesting a
> 32-bit rather than 64-bit variable (-1732234805).
It's in the printf info section (info libc al printf) in the
paragraph just above the format specifiers. Quote:
* An optional conversion qualifier, which may be `h' to specify
`short', `l' to specify long ints, or `L' to specify long doubles.
Long long type can be specified by `L' or `ll'.
>
> Out of curiosity, I thought I might check just in case I should be
> linking in an extra library or the like.
No, it just seems that `ll' doesn't work.
Bill
--
Leave others their otherness.
- Raw text -