www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/10/01:04:20

Date: Wed, 10 Sep 1997 17:04:42 +1100
From: Bill Currie <billc AT blackmagic DOT tait DOT co DOT nz>
Subject: Re: long long int in DJGPP?
In-reply-to: <5v525j$749$1@vnetnews.value.net>
To: mschulter AT value DOT net (M. Schulter)
Cc: djgpp AT delorie DOT com
Message-id: <199709100509.RAA15255@teleng1.tait.co.nz gatekeeper.tait.co.nz>
Organization: Tait Electronics Limited
MIME-version: 1.0
Comments: Authenticated sender is <billc AT blackmagic DOT tait DOT co DOT nz>

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019