From patchwork Wed Feb 26 22:47:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 25435 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 817D5203C4 for ; Wed, 26 Feb 2014 22:47:45 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id kx10sf3475834pab.9 for ; Wed, 26 Feb 2014 14:47:44 -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=4C0I4LeDo6wVZcaWpAoc6luSydcxAc2k33jJodrdxf4=; b=FEheNl6FHRhwIO6pS74NZSg5qSQrGdYd1uY64BL9A/TdCvmd1QAcZlWSJIvKdKA8VH uqvSGxTk2UA+8cAGndmS2PxlqLIb81F7xxZo+WFH3abiD7sArxZCaZDR+z/aAgPTGsYn fMHVq3JavZbYulYybxkt4StqxxOJHR5SL040FUe8r+MJ1apROjfsy0VHN2wwTrLUBn4H kP5zjH9zQg9AHeihKRPKX9vZwLH/QWrC+bvRA9H0Xxwjr9pOMIfpj8+xQdW2hYyGT/Lm zFUfFQDWGGZVQKTdSwePjsK7m/vrP4Qb+Xus2XnFfrk/dtJ32ivENnaEaSiTy1TQzt1f /URw== X-Gm-Message-State: ALoCoQl+04DKXAkMkBIrWUxuWsNi5ZwhW8u+hcjIFT4hm/Kqw32rw6UwGTOTexl4yWRV3E1E8GDs X-Received: by 10.66.231.132 with SMTP id tg4mr4359321pac.31.1393454864729; Wed, 26 Feb 2014 14:47:44 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.87.5 with SMTP id q5ls456799qgd.99.gmail; Wed, 26 Feb 2014 14:47:44 -0800 (PST) X-Received: by 10.52.186.230 with SMTP id fn6mr6712992vdc.14.1393454864557; Wed, 26 Feb 2014 14:47:44 -0800 (PST) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id s10si622249vco.131.2014.02.26.14.47.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 26 Feb 2014 14:47:44 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id id10so1696001vcb.27 for ; Wed, 26 Feb 2014 14:47:44 -0800 (PST) X-Received: by 10.58.190.99 with SMTP id gp3mr2608416vec.32.1393454864442; Wed, 26 Feb 2014 14:47:44 -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 u4csp59979vcz; Wed, 26 Feb 2014 14:47:44 -0800 (PST) X-Received: by 10.194.57.104 with SMTP id h8mr4632402wjq.36.1393454863719; Wed, 26 Feb 2014 14:47:43 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id z9si2247578wiv.52.2014.02.26.14.47.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 26 Feb 2014 14:47:43 -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 1WInGP-0006Qw-Vi; Wed, 26 Feb 2014 22:47:41 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH] tests/Makefile: Suppress format-security warnings on JSON tests Date: Wed, 26 Feb 2014 22:47:41 +0000 Message-Id: <1393454861-24705-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.220.182 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: , Some of our test binaries programmatically generate JSON format strings to feed to qobject_from_json(). Since that function is marked with GCC_FMT_ATTR(), clang complains about this: 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); ^~~~~~~~~~~ Since these are only test cases and not potential attack vectors, the simplest approach is simply to suppress this particular compiler warning when compiling the relevant test cases. Signed-off-by: Peter Maydell --- I couldn't think of a better way to do this... tests/Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Makefile b/tests/Makefile index b17d41e..496c02f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -146,6 +146,17 @@ check-qapi-schema-y := $(addprefix tests/qapi-schema/, \ GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h tests/test-qmp-commands.h +# These tests use the qobject_from_json() function with programmatically +# generated format strings; since this would otherwise trip clang's +# format-security warnings and these are only test binaries, disable +# the warnings when building them. +JSON_USERS=check-qjson \ + check-input-visitor \ + test-qmp-input-visitor \ + test-visitor-serialization + +$(JSON_USERS:%=tests/%.o): CFLAGS += -Wno-format-security + test-obj-y = tests/check-qint.o tests/check-qstring.o tests/check-qdict.o \ tests/check-qlist.o tests/check-qfloat.o tests/check-qjson.o \ tests/test-coroutine.o tests/test-string-output-visitor.o \