stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Travis Vitek" <>
Subject RE: svn commit: r630244 - /stdcxx/trunk/src/time_put.cpp
Date Fri, 22 Feb 2008 17:25:32 GMT

>Martin Sebor wrote:
>While poring through it though, I noticed a reinterpret cast in
>a call to operator delete() further down that was introduced in
>the original patch:
>I don't think that cast is necessary anymore, since we're not
>invoking the delete expression but calling operator delete
>directly (and it doesn't call the dtor on the object).
>I think we can safely remove the cast. Here's the patch I plan
>to commit unless someone speaks up against it in the next couple
>of hours:
>Index: src/time_put.cpp
>--- src/time_put.cpp    (revision 630253)
>+++ src/time_put.cpp    (working copy)
>@@ -615,7 +615,7 @@
>                  _RWSTD_STATIC_CAST(char*, ::operator new (tmpsize));
>              memcpy (tmp, pun, sizeof *pun + off);
>-            ::operator delete (_RWSTD_REINTERPRET_CAST (char*, pun));
>+            ::operator delete (pun);
>              pun      = _RWSTD_REINTERPRET_CAST (__rw_time_t*, tmp);
>              pmem     = _RWSTD_REINTERPRET_CAST 
>(_RWSTD_UINT32_T*, pun);

Yup, the new guy messed up again. I can't imagine why I left the cast, I
know that it isn't necessary.

Your patch looks good though.

View raw message