[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-4.15 2/2] tools/xenstore: Check the format printf for xprintf() and barf{,_perror}()
- To: Jan Beulich <jbeulich@xxxxxxxx>, Jürgen Groß <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Fri, 5 Mar 2021 13:48:15 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RuTTmgQf0YyiuQJRDFN+U13wsziN6B9FJBfsoWOI+zg=; b=OQNwnCVjEH9mJk2TaAcZJk/QgGpPqfXoEQkUW2XEOiGNWNA8QKdAzq/snmuM9zUelcu/9zNp7CAy4JZR8cuRwNb7sVB5JqTdZZCqQ3elOXKZCsRHIN8h2ScVYBOWnjjw5HrS8KYk55faTmjwvE1Yld5fMOsk1MB5WX+a9BUV96N5LMc2RAx02B52fwCHp5f/CDrKQ9absIAzSyLrDqTOX63rstT144MO08MtOrf6CDSF5495ARVHGeFHFOanI/NkFXXrouol/bIBRTEp1pHIXU+aKIf/JnIpTmvogTbuCJUcBFK9of8grBYs2G69M3V4FZqIK9jkT1KpVDGhKTNHDg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hGUyHfKNFSncMRkFTl6v9Fnrh+puBzLAYGxGP+vY5S8WbNyRAVcRpCsxZ2bSqu/AgOwEnbuPTPN/iVUISM6oe5aksOsCSglKxzPk1ZNQV09pH4+8NbBx6A0DbqdshZ/Shw+QdO8skYJBNNSIa0SuRgtidEualc6I+ZKwaHzEWNEvkzatvwwVCh7yIl0cfZwuAZJ1Ebmwg74OEErdmSSHbflYp6aFIVMb6hWoHdaArOQ4oncHGtWyGsIMU9dAoH1yDOMj0HR0qsxBlvwZAFMC2NW0u7BucRk9bjal03GCVTgjAPV2XEaL+R/teF0caMkklkxMfHBbuEEcrTgFI0nQ3Q==
- Authentication-results: esa5.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <raphning@xxxxxxxxxxxx>, <iwj@xxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Fri, 05 Mar 2021 13:49:18 +0000
- Ironport-sdr: vPIbbWU41yKwEh3SeL18d52kuTvNNU/y+wXWIm4uTsfqkYwj/4lPFPO1zct03FqEQTuZF2s8fR Xd1OS1Mv57QrkjQZXmqDvuCB8aaqI7QZrWiVG4IxkJx/LGXzReOa+Aff0lwrRD88iK7lmHJ5CU EHiNjFER7SLT4lGSOzaQXAY3f+rwM/gWoHObua8fhFT+Z3QvtJK9AP4QNu4XHy1DMIY97s+QPO fsrc9jinoh0huj+DlmNxB8093TS7cEiEDKiZL/kjaM+n5hjEZflA9aB54t3ktgSg7lBKx9PFRr Q0A=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 05/03/2021 13:45, Jan Beulich wrote:
> On 05.03.2021 14:01, Jürgen Groß wrote:
>> On 05.03.21 13:40, Julien Grall wrote:
>>> From: Julien Grall <jgrall@xxxxxxxxxx>
>>> --- a/tools/xenstore/utils.h
>>> +++ b/tools/xenstore/utils.h
>>> @@ -29,10 +29,12 @@ const char *dump_state_align(FILE *fp);
>>>
>>> #define PRINTF_ATTRIBUTE(a1, a2) __attribute__((format (printf, a1, a2)))
>>>
>>> -void barf(const char *fmt, ...) __attribute__((noreturn));
>>> -void barf_perror(const char *fmt, ...) __attribute__((noreturn));
>>> +#define __noreturn __attribute__((noreturn))
>>>
>>> -extern void (*xprintf)(const char *fmt, ...);
>>> +void barf(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2);
>>> +void barf_perror(const char *fmt, ...) __noreturn PRINTF_ATTRIBUTE(1, 2);
>>> +
>>> +extern void (*xprintf)(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
>> ... the extern here would be dropped.
> But this isn't a function declaration, but that of a data object.
> With the extern dropped, a common symbol will appear in every CU.
Correct, and some of the containers in Gitlab CI really ought to notice
because GCC 9(? IIRC) defaulted to -fno-common.
~Andrew
|