From patchwork Wed Apr 27 11:11:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 8955041 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ACBA79F65D for ; Wed, 27 Apr 2016 11:14:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D057C200DC for ; Wed, 27 Apr 2016 11:14:25 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EDE2220263 for ; Wed, 27 Apr 2016 11:14:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avNOn-0003ie-Gq; Wed, 27 Apr 2016 11:12:53 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1avNOm-0003ge-I9 for xen-devel@lists.xenproject.org; Wed, 27 Apr 2016 11:12:52 +0000 Received: from [85.158.139.211] by server-2.bemta-5.messagelabs.com id 98/E8-15045-3BE90275; Wed, 27 Apr 2016 11:12:51 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRWlGSWpSXmKPExsXitHSDve7meQr hBjvWyll83zKZyYHR4/CHKywBjFGsmXlJ+RUJrBl726cyFhwXqJjY+o65gXEVbxcjJ4eEgL/E 3F+7WUBsNgEdiYtzd7J1MXJwiAioSNzeawASZhYolvi6qo8VxBYWSJBYe2sNWDmLgKrEh/cnm EBsXgFXicbHR5ggRupKnNy9iR3E5gSKtzVNAKsXEnCReHr7DitEvaDEyZlPWCDma0q0bv/NDm HLSzRvnc0MUa8o0T/vARvETG6J26enMk9g5J+FpH0WkvZZSNoXMDKvYtQoTi0qSy3SNTTXSyr KTM8oyU3MzNE1NDDVy00tLk5MT81JTCrWS87P3cQIDEEGINjBePG05yFGSQ4mJVHehe0K4UJ8 SfkplRmJxRnxRaU5qcWHGGU4OJQkeDv7gHKCRanpqRVpmTnAaIBJS3DwKInwZoKkeYsLEnOLM 9MhUqcYFaXEedeDJARAEhmleXBtsAi8xCgrJczLCHSIEE9BalFuZgmq/CtGcQ5GJWHeVSBTeD LzSuCmvwJazAS0+PIhWZDFJYkIKakGxl03sj2K9i9Vtz6aWuV17ULNTZFt0yytt7PZpwlFTT5 i9r+A65PT+XOpF96UfP5+JXq6+vsm+SPv9j/JnmS9P3F5x+8bFUv/Ta6Zc+2QwtadHJ/rr2vf Zp5/siO4+qCA9HteA83uIywT5cVOaep9+OH44NPlW7esVN8d3uKRbdftOinkXISxWK0SS3FGo qEWc1FxIgCiflV3uwIAAA== X-Env-Sender: prvs=918322aae=roger.pau@citrix.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1461755569!36497481!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.34; banners=-,-,- X-VirusChecked: Checked Received: (qmail 54526 invoked from network); 27 Apr 2016 11:12:51 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-7.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 27 Apr 2016 11:12:51 -0000 X-IronPort-AV: E=Sophos;i="5.24,541,1454976000"; d="scan'208";a="356738731" From: Roger Pau Monne To: Date: Wed, 27 Apr 2016 13:11:48 +0200 Message-ID: <1461755514-23754-11-git-send-email-roger.pau@citrix.com> X-Mailer: git-send-email 2.6.4 (Apple Git-63) In-Reply-To: <1461755514-23754-1-git-send-email-roger.pau@citrix.com> References: <1461755514-23754-1-git-send-email-roger.pau@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Wei Liu , Ian Jackson , Roger Pau Monne Subject: [Xen-devel] [PATCH v3 for-4.7 10/16] libxl: add the printf-like attributes to a couple of functions X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Or else clang complains with: error: format string is not a string literal Signed-off-by: Roger Pau Monné Acked-by: Wei Liu --- Cc: Ian Jackson Cc: Wei Liu --- tools/libxl/libxl_internal.h | 4 ++-- tools/libxl/libxl_save_helper.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h index 8e2cf3e..662d01a 100644 --- a/tools/libxl/libxl_internal.h +++ b/tools/libxl/libxl_internal.h @@ -636,7 +636,7 @@ _hidden void *libxl__realloc(libxl__gc *gc_opt, void *ptr, size_t new_size) NN1; /* print @fmt into an allocated string large enoughto contain the result. * (similar to gc'd asprintf(3)). */ _hidden char *libxl__sprintf(libxl__gc *gc_opt, const char *fmt, ...) PRINTF_ATTRIBUTE(2, 3) NN1; -_hidden char *libxl__vsprintf(libxl__gc *gc, const char *format, va_list ap); +_hidden char *libxl__vsprintf(libxl__gc *gc, const char *format, va_list ap) PRINTF_ATTRIBUTE(2, 0); /* duplicate the string @c (similar to a gc'd strdup(3)). */ _hidden char *libxl__strdup(libxl__gc *gc_opt, const char *c /* may be NULL */) NN1; @@ -709,7 +709,7 @@ _hidden char *libxl__xs_libxl_path(libxl__gc *gc, uint32_t domid); */ int libxl__xs_vprintf(libxl__gc *gc, xs_transaction_t t, - const char *path, const char *fmt, va_list ap); + const char *path, const char *fmt, va_list ap) PRINTF_ATTRIBUTE(4, 0); int libxl__xs_printf(libxl__gc *gc, xs_transaction_t t, const char *path, const char *fmt, ...) PRINTF_ATTRIBUTE(4, 5); diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c index 5fe642a..d3def6b 100644 --- a/tools/libxl/libxl_save_helper.c +++ b/tools/libxl/libxl_save_helper.c @@ -52,6 +52,7 @@ /*----- logger -----*/ +__attribute__((format(printf, 5, 0))) static void tellparent_vmessage(xentoollog_logger *logger_in, xentoollog_level level, int errnoval,