memcpy() comparison: C, Rust, and D

Atila Neves via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 2 06:19:02 PST 2017


On Thursday, 2 February 2017 at 09:28:15 UTC, Walter Bright wrote:
> On 2/2/2017 1:21 AM, Claude wrote:
>> On Wednesday, 1 February 2017 at 21:16:30 UTC, Walter Bright 
>> wrote:
>>> 6. Valgrind isn't available on all platforms, like Windows, 
>>> embedded systems,
>>> phones (?), etc.
>>
>> You can use valgrind on embedded systems as long as they run a 
>> GNU/Linux OS.
>> I've used valgrind successfully many times on ARM architecture.
>> But I don't know if it works with Android, and I doubt it 
>> works on baremetal
>> indeed.
>
> I seem to recall Valgrind wasn't on OSX, either, at one point. 
> Maybe that has since been corrected.

Also, unless you're testing possible bugs in compiler backends or 
the C standard library, it mostly doesn't matter. Compile on 
regular x86/Linux and run valgrind/asan there.

Have I run into weird bugs that only occurred on one platform? 
Yes. Were they _really_ rare? You betcha. *

Atila

* At one point I had a bug where casting from double to uint64_t 
failed for values over the integer maximum for 32-bits... (turns 
out that platform had no FPU and it was a bug in its libc)


More information about the Digitalmars-d mailing list