From patchwork Wed Feb 26 23:51:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25437 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1555220636 for ; Wed, 26 Feb 2014 23:51:50 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id jy13sf3233268veb.10 for ; Wed, 26 Feb 2014 15:51:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=+qooA1rxyZCTu55dPvnimW5sW8ErEOEVe1aAyRc+uFc=; b=a2dKYhvE/cJEh4ycJyWLUeAd1vnM6Z4jTPDhQAmbUM8mOiMDhxNQy+WIuv0smIlBDk YuhyKlbASPWy4kXS1TTkjWIXorJNzC/qoSQ+xCfTKmeeU/h73HW3u0Oj8PNliTqThbEu DbGv3ezYSVcV2iw3VvAECvsVm2r8Bmi02fqh6mVvX6E85c8kr7AeLOqxtPFZTFnHVEmA OcSNtMC4me5K6+K5qkOgh+FVXYENj/IVnRRdVOW7HmFdrtIMHjKsGRy9+bFKsqZikWl7 iAcHfnBsWh+fqqH7h/iZ2V41vyN8LatA4ibTM6FnJbw2zOysYDp9vLKf1WhSIv9Tge+h KLcA== X-Gm-Message-State: ALoCoQkzQ/81gaTuui6Q5Ilp+9RMeNZq3ezlmo0boF5gHRXwYYMaPUjqZ3d1ABrStDw7nM9pndR6 X-Received: by 10.236.20.114 with SMTP id o78mr3436442yho.8.1393458709794; Wed, 26 Feb 2014 15:51:49 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.49.231 with SMTP id q94ls465326qga.45.gmail; Wed, 26 Feb 2014 15:51:49 -0800 (PST) X-Received: by 10.52.30.230 with SMTP id v6mr6756918vdh.6.1393458709701; Wed, 26 Feb 2014 15:51:49 -0800 (PST) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id eb8si666685vdb.47.2014.02.26.15.51.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 15:51:49 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id pa12so1428523veb.14 for ; Wed, 26 Feb 2014 15:51:49 -0800 (PST) X-Received: by 10.58.204.4 with SMTP id ku4mr2467vec.34.1393458709629; Wed, 26 Feb 2014 15:51:49 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp63165vcz; Wed, 26 Feb 2014 15:51:49 -0800 (PST) X-Received: by 10.194.192.233 with SMTP id hj9mr75822wjc.78.1393458708769; Wed, 26 Feb 2014 15:51:48 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id b8si11469993wiy.49.2014.02.26.15.51.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 15:51:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1WIoGQ-0006To-QV; Wed, 26 Feb 2014 23:51:46 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Paolo Bonzini Subject: [PATCH] qjson.h: Remove spurious GCC_FMT_ATTR markup from qobject_from_json() declaration Date: Wed, 26 Feb 2014 23:51:46 +0000 Message-Id: <1393458706-24883-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The function qobject_from_json() doesn't actually allow its argument to be a format string -- it passes a NULL va_list* to qobject_from_jsonv(), and the parser code will then never actually intepret %-escape sequences (it tests whether the va_list pointer is NULL and will stop with a parse error). The spurious attribute markup causes clang warnings in some of the test cases where we programmatically construct JSON to feed to qobject_from_json(): tests/test-qmp-input-visitor.c:76:35: warning: format string is not a string literal (potentially insecure) [-Wformat-security] data->obj = qobject_from_json(json_string); ^~~~~~~~~~~ Remove the incorrect attribute. Signed-off-by: Peter Maydell Suggested-by: Paolo Bonzini Reviewed-by: Andreas Färber --- include/qapi/qmp/qjson.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qapi/qmp/qjson.h b/include/qapi/qmp/qjson.h index 73351ed..ee4d31a 100644 --- a/include/qapi/qmp/qjson.h +++ b/include/qapi/qmp/qjson.h @@ -19,7 +19,7 @@ #include "qapi/qmp/qobject.h" #include "qapi/qmp/qstring.h" -QObject *qobject_from_json(const char *string) GCC_FMT_ATTR(1, 0); +QObject *qobject_from_json(const char *string); QObject *qobject_from_jsonf(const char *string, ...) GCC_FMT_ATTR(1, 2); QObject *qobject_from_jsonv(const char *string, va_list *ap) GCC_FMT_ATTR(1, 0);