RFR(XXS): 7133111: libsaproc debug print should be printed as unsigned long to fit large numbers on 64bit platform (original) (raw)

Markus Grönlund markus.gronlund at oracle.com
Thu Apr 5 10:04:03 PDT 2012


Thanks Staffan,

Ok by me.

/Markus

-----Original Message----- From: Staffan Larsen Sent: den 5 april 2012 18:34 To: Markus Grönlund Cc: serviceability-dev Subject: Re: RFR(XXS): 7133111: libsaproc debug print should be printed as unsigned long to fit large numbers on 64bit platform

Yes, this is linux-only code. We don't use compilers other than gcc to compile this code. /Staffan On 5 apr 2012, at 16:15, Markus Grönlund wrote: > Staffan, > > Is this code only going to be built/executed on a Linux system (i.e. gcc compiled)? I guess so (since it says src/os/linux/) - I think %zd is a gcc specific extension right? > > (Visual C++ for instance uses %lu and %ld respectively where gcc has %zu and %zd) > > Is that a problem that we might be using C++ compilers not adhering to C99/or gcc extensions on other platforms (don't know if/how we cross-compile)? > > /Markus > >> -----Original Message----- >> From: Staffan Larsen >> Sent: den 5 april 2012 14:25 >> To: serviceability-dev >> Subject: RFR(XXS): 7133111: libsaproc debug print should be printed as >> unsigned long to fit large numbers on 64bit platform >> >> Please review the following one-character fix to a printf format >> string. A 'z' is added to the printout of a sizet field. >> >> Thanks, >> /Staffan >> >> >> diff --git a/agent/src/os/linux/pscore.c >> b/agent/src/os/linux/pscore.c >> --- a/agent/src/os/linux/pscore.c >> +++ b/agent/src/os/linux/pscore.c >> @@ -440,7 +440,7 @@ >> int j = 0; >> printdebug("---- sorted virtual address map ----\n"); >> for (j = 0; j < ph->core->nummaps; j++) { >> - printdebug("base = 0x%lx\tsize = %d\n", ph->core- >>> maparray[j]->vaddr, >> + printdebug("base = 0x%lx\tsize = %zd\n", ph->core- >>> maparray[j]->vaddr, >> ph->core->maparray[j]- >>> memsz); >> } >> }



More information about the serviceability-dev mailing list