[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tools/libs/stat: fix broken build


  • To: Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 11 Sep 2020 20:08:19 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Fri, 11 Sep 2020 19:08:28 +0000
  • Ironport-sdr: /PX050qKnpuJHCpxlq1RY23WHMP2dSDV3K1YvUhKFk0AlzMzob67R8GKVoQjNvITiLWM58QFaK jkh9zMLnzr3c3/yqFcK/lpmJyZmORJrMS40m0fhWPqrw15Z3vtPWWMkD1mAnzWlH8y7nGfwj1P c0S9auIHVbRNe/Kl0wuEKZlMesbZD9lUhhT57KH28TvwZZIcffSrnhgMyY2t0qJ09+qNsodB1o oOkEBGsixy1ARP0uYrOjAsGCilOd43SNvyQ76NeZ/uifCNgqj+aBhd1y3A+LULsjuDciDlqpm0 Pzs=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11/09/2020 18:58, Wei Liu wrote:
> On Fri, Sep 11, 2020 at 03:15:28PM +0200, Juergen Gross wrote:
>> Making getBridge() static triggered a build error with some gcc versions:
>>
>> error: 'strncpy' output may be truncated copying 15 bytes from a string of
>> length 255 [-Werror=stringop-truncation]
>>
>> Fix that by printing a sane error message and bailing out in case the name of
>> a bridge is too long.
>>
>> Fixes: 6d0ec053907794 ("tools: split libxenstat into new tools/libs/stat 
>> directory")
> But this patch is not the one that created the bug though? It just
> happens to be the last patch that touched that file.

It "created" the bug by making getBridge() static, and therefore inlined
into its sole caller, and therefore able to be analysed in this way by
the compiler.

That said, Gitlab CI says no to this as a viable bugfix.

~Andrew



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.