From patchwork Wed Jun 27 15:38:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 140359 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1036584ljj; Wed, 27 Jun 2018 08:38:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcxuuHrbyVR10kwwNFjLPISCBPTmPlH+SjMaWUJ/UFQkoPagNAq2bZDKxABOPxDet2QsJ0B X-Received: by 2002:a1c:470b:: with SMTP id u11-v6mr5181176wma.49.1530113900152; Wed, 27 Jun 2018 08:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530113900; cv=none; d=google.com; s=arc-20160816; b=KPjFOX/uEtcM4oGBOVnpwsFyxz0Yn/TyXPadbk8nUzpNpvCTNN73h0bgxI1XFUAcD1 Enhtbg5CQ/OZ4UbMRnugrrXqQAYDHJfiOWqhrAAoKcBhbl9CwJGmiGrhBWWLLTshFg+t KCcUznwVAHcHRnFI+yv90C29Q0HIMQ7Z/Wm+BlE16B/3kQ/Edu0FqLhpjEIhyr4giZ7e wc40euqNqdKppQhrb/WCRjMTGbwuBSarre9Ks342yTbbOwF4g/ONUz9RdxgbxmqF1OuE g3BQ4/QQxqqmzolnbloqBHEL8g0rpnrZghC7l63zTggWZBF8PzLIDxpeSj/PXHevE5AI EzhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=+zF2Bzv4i/7jVMjUMHDtvOtq/yzyE4/6cFbZKjFWV3M=; b=JT63UB0xm9R9enJZMPP+QFV5E9gZQlHAA2/CUqMKLlD+3KA0NACeSGgW8fgW7szevc O5VauTRexPG/OrX9vIvhJdvmtgCNh0T4pSYCHLQ+9lauT749sDLZorYvKf4FuSx52i7k Fjuv8z+k/2Qsh7B6TTigulkEME4p/QDE1m1ZGFIx/6G+BMyqiiiHClQ/WYguXvlToG1F 1ot4kBwHUL/OmUp2aib/qk/VRobNdKb0DwtU7if1H+DVdxYnOUw8C+PIDL/GABfVRvRI yl8FC6fzF0fuX7KXGAp8OJzhc7kbJSyN8pa5WnmXUUEK6HyA/gwW8eqkz0nwrDShUhF3 O+Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=N80BjNtk; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from picard.linux.it (picard.linux.it. [2001:1418:10:5::2]) by mx.google.com with ESMTPS id w15-v6si3898834wrr.274.2018.06.27.08.38.20 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) client-ip=2001:1418:10:5::2; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=N80BjNtk; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id BF9DC1A9611 for ; Wed, 27 Jun 2018 17:38:19 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) by picard.linux.it (Postfix) with ESMTP id A59423E60F2 for ; Wed, 27 Jun 2018 17:38:15 +0200 (CEST) Received: from mail-qk0-x234.google.com (mail-qk0-x234.google.com [IPv6:2607:f8b0:400d:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-7.smtp.seeweb.it (Postfix) with ESMTPS id A848720039F for ; Wed, 27 Jun 2018 17:38:14 +0200 (CEST) Received: by mail-qk0-x234.google.com with SMTP id t79-v6so1274589qke.4 for ; Wed, 27 Jun 2018 08:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XwL4VQb/r6BRbS71YTWzpGDd40nylEVXsmEWC7wr0eE=; b=N80BjNtkUtiMQ96SW5a33PH9+JoL5LfXsZjhoeeJACR4d6Cns7ReCgqyIR24lVnd0z +jaBtjT5UorHu66oO5GCQ3SBDXuQEbbKLguPJ8xZVd1aSSwrXX/MCjx0jW6ZOm3acCTg SHDkak414FNgnKUjEs3ovuza3oiivHbWbHSZI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=XwL4VQb/r6BRbS71YTWzpGDd40nylEVXsmEWC7wr0eE=; b=aIWSDcV/oaoPnLPMD9GHLD89feUclXabhfTk4rw9olNlBmPf8MQ6+OtGz8xEyktcGw KXvlda+lilgS6oYOFaXxqa/ku6op4kbY9BzEXxh+GHwv2r3hJ7ozAtIbaTrROx0Uagfh KlOooAznYs7/BwTXYRWSkzBPZ08UrG4vhLgOlcJ+1d0mzLGiveh0jz8ata0y4VaI4T7+ qLwkHdHaDT+C3eLfYpjFx5p7Hog4kNHQ7hb3z3i3iJ4J61CIxpt0siGdX7qE3e7DluWG x4Ww4BDzaGPagsd1xmw81NNAaZulaB1jNXhhChfn0adOzV7sXwv//UFmMlb1qTvAmEg6 8Q4g== X-Gm-Message-State: APt69E02pc/wVuc5SvjAdbBVIcvU8s3il/lsHjvAgjig/mcIMFgOJnex f3fmI5L18yMn1Qlfvo/OEd187/Zvufw= X-Received: by 2002:a37:a64a:: with SMTP id p71-v6mr5470997qke.344.1530113893093; Wed, 27 Jun 2018 08:38:13 -0700 (PDT) Received: from ltpamd64.celeiro.br. ([138.204.25.70]) by smtp.gmail.com with ESMTPSA id i4-v6sm2772744qtp.44.2018.06.27.08.38.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jun 2018 08:38:12 -0700 (PDT) From: Rafael David Tinoco To: ltp@lists.linux.it Date: Wed, 27 Jun 2018 15:38:09 +0000 Message-Id: <20180627153809.1196-1-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-7.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-7.smtp.seeweb.it Cc: rafael.tinoco@linaro.org Subject: [LTP] [PATCH] syscalls/fallocate05: minor fix for Werror=format-security X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" In order to avoid compilation issues in tst_XXX functions: gcc -g -O0 -fdebug-prefix-map=. -fstack-protector-strong -Wformat -Werror=format-security-g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -Wdate-time -I../../../../include -I../../../../include -I../../../../include/old/ -Wl,-z,relro -L../../../../lib fallocate05.c -lltp -o fallocate05 fallocate05.c: In function ‘run’: fallocate05.c:76:4: error: format not a string literal and no format arguments [-Werror=format-security] tst_brk(TCONF, tested_flags); ^~~~~~~ fallocate05.c:78:3: error: format not a string literal and no format arguments [-Werror=format-security] tst_brk(TBROK | TERRNO, tested_flags); ^~~~~~~ fallocate05.c:80:2: error: format not a string literal and no format arguments [-Werror=format-security] tst_res(TPASS, tested_flags); when using format-security, change "const char *" to a pre-defined string. Signed-off-by: Rafael David Tinoco --- testcases/kernel/syscalls/fallocate/fallocate05.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testcases/kernel/syscalls/fallocate/fallocate05.c b/testcases/kernel/syscalls/fallocate/fallocate05.c index d2d84433b..49dc44b04 100644 --- a/testcases/kernel/syscalls/fallocate/fallocate05.c +++ b/testcases/kernel/syscalls/fallocate/fallocate05.c @@ -30,6 +30,7 @@ #define MNTPOINT "mntpoint" #define FALLOCATE_SIZE 8192 +#define TESTED_FLAGS "fallocate(FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE)" static int fd; @@ -37,7 +38,6 @@ static void run(void) { char buf[FALLOCATE_SIZE]; ssize_t ret; - const char *tested_flags="fallocate(FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE)"; fd = SAFE_OPEN(MNTPOINT "/test_file", O_WRONLY | O_CREAT); @@ -73,11 +73,11 @@ static void run(void) ret = fallocate(fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, FALLOCATE_SIZE); if (ret == -1) { if (errno == EOPNOTSUPP) - tst_brk(TCONF, tested_flags); + tst_brk(TCONF, TESTED_FLAGS); - tst_brk(TBROK | TERRNO, tested_flags); + tst_brk(TBROK | TERRNO, TESTED_FLAGS); } - tst_res(TPASS, tested_flags); + tst_res(TPASS, TESTED_FLAGS); ret = write(fd, buf, 10); if (ret == -1)