[GOLD] gcc-11 stringop-overflow warning

Jeff Law law@redhat.com
Wed Dec 9 00:32:19 GMT 2020



On 12/7/20 10:22 AM, Cary Coutant via Binutils wrote:
>> Applied as obvious, or at least, not wrong.
>>
>>         * plugin.cc (Plugin_recorder::init): Replace strncpy with memcpy.
>>
> Yes, I like that better. Seems like a reasonable warning, even if it isn't
> flagging incorrect code. Thanks!
Yea.  That's the most common false positive we've seen with this
diagnostic and changing it to a memcpy is the preferred solution.  It
happens to be more efficient too :-)

jeff



More information about the Binutils mailing list