[PATCH] Don't pass NULL to memcpy in gdb

Tom Tromey tom@tromey.com
Sun Mar 22 19:04:16 GMT 2020


>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>> While it would be better to fix this in the standard, in the meantime
>> it seems easy to avoid this error.

Simon> I hope you're joking here :).  But otherwise, this LGTM.

I actually do think it would be better for the standard to change to say
that memcpy should accept NULL pointers provided that the length is 0.
Probably most implementations already work this way and it seems
harmless to allow.  It also seems relatively unlikely to change though.

Tom


More information about the Gdb-patches mailing list