From patchwork Fri Nov 30 10:45:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 152507 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp3500048ljp; Fri, 30 Nov 2018 02:45:19 -0800 (PST) X-Google-Smtp-Source: AFSGD/W/b6Yk92SbIVzJFvJZ0rWG4nrCEMlAhSE+Zbl8dzvzQs2i5SXY9Zj/xkS/soC/y/Vw7Jo6 X-Received: by 2002:a63:5207:: with SMTP id g7mr4471648pgb.253.1543574718933; Fri, 30 Nov 2018 02:45:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543574718; cv=none; d=google.com; s=arc-20160816; b=V3o7ZK5DR/NgL2QSmW/23O6kqacA8mMxKPj+lzzxhV1L49WrA0EVbbVFM3lrI/w1vn k9tLoRUHrWfFzlft3OBE8Bwk8x3WlqcC0G+ACPXq1ZOMAkpn5GoEiVk/blkMPvvNyZrg z7if0JXKxWcfhMHf3oMWviu4xCMrZ5ssAWQg876HKmEsxy5Zu4AwjnbTY5dcTaUp6tSF tXdKUMitH6P1qKEp9qvdAd5M0MqcV71jEsK1SV0AGJtNOS0ayWEDtIho4mg8e7W/vJRQ jkK7F5JgmM2iyTD9LMgOoXBjrgwsqUuv5eTK7DIBKH57BlaVy0VEMz+C0BnmWWxonML/ DH5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=LdqW9p5oQ6hz1Ta4UYRb+3uWy/TwW+aCyvRMzZG2AQo=; b=lW9pGRYBGTcw6Rr+HqAb/4uCXkWUogYeKY2NKxzZvqJpc792f+ZHiIRCtdj4C2FmVT psqL75IJZCbCvABtxs+j2MSH5DEFwZusIinJy9B2InOalmylniHDvLjSKWlgrEGDICVr bHp3SkAKAkUyoeKQwbFO3p8clBHbNmKydiwB0K8hYheOLQ+pvqGrQR0KsJA1v4ii/0sb JUYCGLijhQIQmA24w14oBux6hZ3uf4c7fPRlqmKgJpAlC1pO2IadWYyHVU032aHwZlrm ZOHbwlCKaD2/4vv2k4OtTcOEn94DfdDEDHoyZ7Uvxq35gWKNYO8VU7rKD3zbMZh+4lLl 11uA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=piglit-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p3si4652301plr.376.2018.11.30.02.45.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Nov 2018 02:45:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=piglit-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 28EFE6E5EC; Fri, 30 Nov 2018 10:45:18 +0000 (UTC) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id A2A926E5EA for ; Fri, 30 Nov 2018 10:45:16 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id r11-v6so5272578wmb.2 for ; Fri, 30 Nov 2018 02:45:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=qF11YoakAlyutl0tk3zmB9elNQVmshycBbAoq1pnNgc=; b=U5YvNjEnDZA775zcdvVq2AbJwBnb/YIuq5h/lIMC99HeHvB3ik4E8eNa6FvgGXHLFL uw4cLGvgHrntkL5Z0aXSio5NYqy/WTsPKlW94RrlBcfX+G2/KOsSnEn2zyHQmRtK1wab aYiTkoGtPIoiVgDN8959Gl7PQ02Utx+h8cItStfBcAZe2gawDDbI0e5wIkyhPYwAiPsL TY9c3Y0+mjlz8mwTrIbUElX10JQmH6Aj0En6pNx6XBt6948vQx0PUHOKr3MyZjet6+16 p347Q4VXttpcOWXdVzWwJZPuZE6/vK7hpV1x0Ctb95arW35jaKwrDwuT+lo4dXg8uC1f ZCAg== X-Gm-Message-State: AA+aEWbEwztzM74otKs9/XKi37XShxddC5tbErtBkEUgyuVFKW6ttX8G scP6bK/27wI0AlsPZXxn1yNh16Jvix8= X-Received: by 2002:a1c:d1cd:: with SMTP id i196mr4923194wmg.107.1543574715006; Fri, 30 Nov 2018 02:45:15 -0800 (PST) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id y138sm3566258wmc.16.2018.11.30.02.45.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 02:45:14 -0800 (PST) From: Ross Burton To: piglit@lists.freedesktop.org Date: Fri, 30 Nov 2018 10:45:06 +0000 Message-Id: <20181130104506.4658-3-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181130104506.4658-1-ross.burton@intel.com> References: <20181130104506.4658-1-ross.burton@intel.com> Subject: [Piglit] [PATCH 3/3] arb_texture_view: fix security format warnings X-BeenThere: piglit@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: piglit-bounces@lists.freedesktop.org Sender: "Piglit" If built with -Werror=format-security then Piglit fails to build: /tests/spec/arb_texture_view/rendering-layers-image.c:150:8: error: format not a string literal and no format arguments [-Werror=format-security] (desc)); \ ^~~~~~ In this case test->uniform_type is being turned into a string using snprintf() and then passed to piglit_report_subtest_result() which takes a format string, but GCC can't verify the format. As _subtest_report() takes a format string, we can just remove the snprintf() and let it construct the label. Signed-off-by: Ross Burton Reviewed-by: Eric Engestrom --- tests/spec/arb_texture_view/rendering-layers-image.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/spec/arb_texture_view/rendering-layers-image.c b/tests/spec/arb_texture_view/rendering-layers-image.c index 415b01657..070e29a68 100644 --- a/tests/spec/arb_texture_view/rendering-layers-image.c +++ b/tests/spec/arb_texture_view/rendering-layers-image.c @@ -142,12 +142,12 @@ test_render_layers(const struct test_info *test) return pass; } -#define X(f, desc) \ +#define X(f, test_type) \ do { \ const bool subtest_pass = (f); \ piglit_report_subtest_result(subtest_pass \ ? PIGLIT_PASS : PIGLIT_FAIL, \ - (desc)); \ + "layers rendering of %s", (test_type)); \ pass = pass && subtest_pass; \ } while (0) @@ -157,9 +157,7 @@ piglit_display(void) bool pass = true; for (int test_idx = 0; test_idx < ARRAY_SIZE(tests); test_idx++) { const struct test_info *test = &tests[test_idx]; - char test_name[128]; - snprintf(test_name, sizeof(test_name), "layers rendering of %s", test->uniform_type); - X(test_render_layers(test), test_name); + X(test_render_layers(test), test->uniform_type); } #undef X pass = piglit_check_gl_error(GL_NO_ERROR) && pass;