gcc4.7 - GCC 4.6.3 vs 4.7.3: Difference in printing greg_t for x86_64 -


i attempting fix build error.

the offending line of code follows:

fprintf(crashlog, "rip: %lx\n", context->uc_mcontext.gregs[reg_rip]); 

and hence:

  • gregs of type gregset_t
  • gregs[i] of type greg_t

now code (which producing core dump , stack trace) has been working long time, recently, gcc 4.7.3 (ubuntu 13.04) has started reject it:

error: format ‘%lx’ expects argument of type ‘long unsigned int’, argument 3 has type ‘greg_t {aka long long int}’ [-werror=format] 

fine. change offending line to:

fprintf(crashlog, "rip: %llx\n", context->uc_mcontext.gregs[reg_rip]); 

but gcc 4.6.3 (ubuntu 12.04) complains instead:

error: format ‘%llx’ expects argument of type ‘long long unsigned int’, argument 3 has type ‘greg_t {aka long int}’ [-werror=format] 

there's ifdef's in section of code various registers, can add another, there nice clean way (especially without needing ifdef)?


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -