Re: Long long int's and sprintf

From: Cris Jacobin (
Date: 06/16/01

> Daniel A. Koepke wrote...
> That's really very bizarre.  First, AFAIK, (1ULL << 36) should be just
> as
> valid as what I recommended.  The longer form that I used is, I thought,
> out of personal preference (something I probably should've noted in the
> previous message, sorry) and entirely unnecessary.  Second, your
> compiler
> should at least warn about doing
>   sprintf(buf, "... %lld ...", ..., (1ULL << 36), ...);
> since you're providing an unsigned value for a signed conversion.  What
> compiler are you using?  Are all the warnings turned on?

   Well thanks to your help it's all working now.  Using the (xull <<
xull) format you suggested along with the llu format.

   I am using gcc on a box running the latest redhat.  I receive warnings
if the format differs from the argument in the sprinf calls.  The
compiler was quite helpfull in telling me what had to be edited.  I did
not receive warnings however with the defines.

  One other thing for the archives, in case anyone decides to take this
route.  It's actually fairly easy to implement.  Took me around a half
hour from start to finish.  The trick is, if you only want affects don't
make everything a wide bitvector.  There was no need to play with
roomflags and such, which eliminated the need to play around with the
ascii conversion  routines.

-Jac 'I think 64 bits will last me awhile.'

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/05/01 PST