You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by Andreas Fester <An...@gmx.de> on 2005/10/29 13:04:04 UTC

Re: [PATCH][RFC] fix 64bit log4cxx_intptr_t

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have investigated a more portable way of getting rid
of the warning on AMD64 regarding the log4cxx_intptr_t type.
This type is only used in StringHelper::formatHex(),
which iteself is again only used to convert the thread
id returned by apr_os_thread_current().
The APR itself already provides a portable way of converting
an apr_os_thread_id to a string by passing a special format
specifier to apr_snprintf(). Thus, my solution (patch attached)
is to use this portable method and to completely remove the
not-so-portable log4cxx_intptr_t type.
Drawback(?): this specific format specifier for apr_os_thread_id
was introduced as new feature with APR 1.2, which would mean
that APR 1.2 will be mandatory (not a big issue in my opinion)
starting with this patch.
Any comments?

Thanks and best Regards,

  Andreas

- --
Andreas Fester
mailto:andreas@littletux.net
WWW: http://www.littletux.net
ICQ: 326674288
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDY1cjZ3bQVzeW+rsRAqFGAKCqeFiO2MaxSDjRxoJVGf1mSRfdtgCfRv8O
1dbI/zo7pIhzS2lJRMe6pzY=
=RLX4
-----END PGP SIGNATURE-----

Re: [PATCH][RFC] fix 64bit log4cxx_intptr_t

Posted by Andreas Fester <An...@gmx.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mihai,

[...]
>>Any comments?
> 
> 
> Hi Andreas
> 
> I have none, sounds like a better solution from my point of view (hope 
Ok, great; I found one meanwhile though ;-)
The "%pt" format of apr_snprintf() requires the *address* of
the apr_os_thread_t variable. Strangely the unittests succeeded
on my desktop linux box, but not during the nightly build on my
server ...
Corrected patch is attached.

Best Regards,

	Andreas

- --
Andreas Fester
mailto:andreas@littletux.net
WWW: http://www.littletux.net
ICQ: 326674288
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDZd1CZ3bQVzeW+rsRAraOAJ9PWgzYZxBPotPeyuw9EmAbY9EAWQCgt/Cd
k21+TIwlX77rCuz7SLHiM7Y=
=M9UR
-----END PGP SIGNATURE-----

Re: [PATCH][RFC] fix 64bit log4cxx_intptr_t

Posted by Andreas Fester <An...@gmx.de>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Mihai,

[...]
>>Any comments?
> 
> 
> Hi Andreas
> 
> I have none, sounds like a better solution from my point of view (hope 
Ok, great; I found one meanwhile though ;-)
The "%pt" format of apr_snprintf() requires the *address* of
the apr_os_thread_t variable. Strangely the unittests succeeded
on my desktop linux box, but not during the nightly build on my
server ...
Corrected patch is attached.

Best Regards,

	Andreas

- --
Andreas Fester
mailto:andreas@littletux.net
WWW: http://www.littletux.net
ICQ: 326674288
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDZd1CZ3bQVzeW+rsRAraOAJ9PWgzYZxBPotPeyuw9EmAbY9EAWQCgt/Cd
k21+TIwlX77rCuz7SLHiM7Y=
=M9UR
-----END PGP SIGNATURE-----

Re: [PATCH][RFC] fix 64bit log4cxx_intptr_t

Posted by Mihai Rusu <di...@roedu.net>.
On Sat, Oct 29, 2005 at 01:04:04PM +0200, Andreas Fester wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi,
> 
> I have investigated a more portable way of getting rid
> of the warning on AMD64 regarding the log4cxx_intptr_t type.
> This type is only used in StringHelper::formatHex(),
> which iteself is again only used to convert the thread
> id returned by apr_os_thread_current().
> The APR itself already provides a portable way of converting
> an apr_os_thread_id to a string by passing a special format
> specifier to apr_snprintf(). Thus, my solution (patch attached)
> is to use this portable method and to completely remove the
> not-so-portable log4cxx_intptr_t type.
> Drawback(?): this specific format specifier for apr_os_thread_id
> was introduced as new feature with APR 1.2, which would mean
> that APR 1.2 will be mandatory (not a big issue in my opinion)
> starting with this patch.
> Any comments?

Hi Andreas

I have none, sounds like a better solution from my point of view (hope 
that I don't have to patch APR 1.2 too with the bugs I reported on this 
list some time ago).

Mihai RUSU                                    Email: dizzy@roedu.net
GPG : http://dizzy.roedu.net/dizzy-gpg.txt    WWW: http://dizzy.roedu.net
                       "Linux is obsolete" -- AST