1

I am trying to print an unsigned long long value. I used printf and %llu. When I use cygwin on Windows 7, I get a value printed. When I do the same thing with cygwin on Windows Xp, I am getting a crash. Any ideas on how to get it printed.
Code Snippet

printf("%s: Initial endClock= %llu Line %d of %s\n",
                        __FUNCTION__,temp, __LINE__, __FILE__);  

Where temp is defined as unsigned long long

Also would like to know whether %llu is a standard part of c

Output of gcc -v is

gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125) 
7
  • 2
    Can you post a code snippet that reproduces the crash on XP?
    – Eitan T
    Jul 26, 2012 at 6:37
  • 1
    unsigned long long and the %llu format are standard from C99 on. gcc had them already before that. If your XP compiler is a C89 compiler, that wouldn't know the type or format, but I think Cygwin uses gcc, so that should have no problems with it. Can you give more details, compiler on XP, Cygwin version? Jul 26, 2012 at 12:25
  • To expand on Daniel's comment - please show the command line used to compile and show the output of gcc -v. I have a feeling you may be using MinGW, not Cygwin. If that's the case, this answer may explain what's going on: stackoverflow.com/a/7136886/12711 Jul 26, 2012 at 18:03
  • gcc 3.4.4 was released in 2005. Your runtime is probably just as old. You might want consider updating your cygwin distribution. Jul 27, 2012 at 3:59
  • The same cygwin distribution runs on a Win7 machine without this problem. stackoverflow.com/questions/5997258/… gave me the explanation I was looking for
    – bobby
    Jul 27, 2012 at 4:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.