search for: mempcy

Displaying 7 results from an estimated 7 matches for "mempcy".

Did you mean: mempcpy
2013 Jul 23
0
[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
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. On Tue, Jul 23, 2013 at 12:29 PM, Paweł Bylica <pawel.bylica at ibs.org.pl>wrote: > Hi, > > Recently I was hit by an assert in WinCOFFObjectWriter that had forbidden > storing pointer to string table in header name field when the pointer had > more that 6 decimal digits. Th...
2013 Jul 23
4
[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
On 23.07.2013 18:43, Reid Kleckner wrote: > 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. snprintf always null-terminates (and truncates if there's not enough space). -Nico
2013 Jul 23
4
[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
Hi, Recently I was hit by an assert in WinCOFFObjectWriter that had forbidden storing pointer to string table in header name field when the pointer had more that 6 decimal digits. This limit had been chosen to make implementation easier (sprintf adds null character at the end) and could be increased to 7 digits. My patch is attached. The implementation uses additional buffer on the stack to make
2013 Jul 23
1
[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
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? -- "The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline> The Computer Graphics Museum <http://computergraphicsmuseum.org>...
2013 Jul 23
1
[LLVMdev] Cutting down the number of platform checks
...an ifdef for this macro, but I suspect we include string.h elsewhere unconditionally. http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Errno.cpp?revision=167191&view=markup Is everyone OK with eliminating checks for headers and symbols that we use unconditionally anyway? (assert.h, mempcy, etc) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130723/d555269c/attachment.html>
2014 Nov 29
3
[LLVMdev] Frontend: How to use Member to Function Pointer as callbacks
...LLVM frontend I am currently working on ( https://github.com/xen2/SharpLang ), I would need some help/hint about how to properly design "PInvoke callbacks". Through "PInvoke" mechanism .NET allows you to call C functions, i.e.: C#: [DllImport("libc.so")] extern void mempcy(void* dest, void* src, int size); // declaration of C function memcpy(ptr1, ptr2, 32); // let's use it in C# code That's quite easy to support. However, the tricky part is that C# functions pointers (callbacks, a.k.a delegate) can be transmitted to those C functions: C: void MethodWithCal...
2013 Jul 23
0
[LLVMdev] [Patch] WinCOFFObjectWriter: fix for storing pointer to string table in header name field
On Tue, Jul 23, 2013 at 12:48 PM, Nico Rieck <nico.rieck at gmail.com> wrote: > On 23.07.2013 18:43, Reid Kleckner wrote: > >> 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. >> > > snprintf always null-terminates (and truncates if there's not enough > space). Nuh uh: "The _snprintf function formats and stores count or fewer characters in buffer, and appends a terminating null character if the formatted string length is strictly less than coun...