[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field

PaweĊ‚ Bylica chfast at gmail.com
Tue Jul 23 15:07:16 PDT 2013


On Tue, Jul 23, 2013 at 8:36 PM, Richard <legalize at xmission.com> wrote:

>
> In article <CACs=
> ty+7zKZU6Ad4jZ5J5Rb0qoMa-bNtO0f+xK_8SYfy3RyFbg at mail.gmail.com>,
>     Reid Kleckner <rnk at google.com> writes:
>
> > Is there a problem if the string is not null terminated?  If not, you can
> > snprintf it right into place instead of doing sprintf+mempcy.
>
> Am I the only one who scratches my head and says:
>
>         sprintf?
>         memcpy?
>
> Why are we using error-prone C APIs in C++ code?


I've just kept the style of the previous implementation. I'd love to use
std::to_string(), but it is just not available. Moreover, you still have to
move this 8 bytes of text somehow.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130724/ce2d96b5/attachment.html>


More information about the llvm-dev mailing list