> -----Original Message-----
> From: Ingo.Struewing@stripped [mailto:Ingo.Struewing@stripped]
> Sent: Thursday, November 06, 2008 3:58 PM
> To: Guilhem Bichot
> Cc: commits@stripped
> Subject: Re: bzr commit into mysql-6.0-backup branch
> (ingo.struewing:2672) Bug#38133
<skip>
> ...
> >> + DBUG_PRINT("myisamlog", ("found info: 0x%lx file: '%s' "
> >> + "used: %d closed: %d",
> >> + (long) curr_file_info,
> >> curr_file_info->name,
> >
> > About 0x%lx, I see %p is spreading in the current MySQL code these
> last
> > months; I believe it's because most compilers which we use support
> %p.
>
> I can remember absolute prohibition by Monty. This has never been taken
> back to my knowledge. There are a lot more conventions that degenerate
> because new colleagues are not taught to adhere to them...
Hi Ingo,
The current coding style
http://forge.mysql.com/wiki/MySQL_Internals_Coding_Guidelines states
Do not use the %p marker of printf() (fprintf(), vprintf(), etc) because it
leads to different outputs (for example on some Linux and Mac OS X the
output starts with 0x while it does not on some Solaris). In MySQL 6.0 and
later, use my_vsnprintf, DBUG_PRINT with %p for pointer formatting
consistent across different platforms.In earlier versions, use printf-family
functions with 0x%lx, but beware it truncates pointers on 64-bit Windows.
Being sure that there is always 0x enables us to quickly identify pointer
values in the DBUG trace.
Right, it was one of the new colleagues (me) who added %p to it and to DBUG
with my_vsnprintf, and I was talking to monty and serg too. I found
half-pointers that DBUG output on my own machine not very useful.