public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] faccessat and fchmodat: Fix build warnings
@ 2017-06-19 13:31 naresh.kamboju
  2017-06-19 17:28 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: naresh.kamboju @ 2017-06-19 13:31 UTC (permalink / raw)
  To: ltp

From: Naresh Kamboju <naresh.kamboju@linaro.org>

Fixing below build warnings.

ltp-full-20170516/testcases/kernel/syscalls/faccessat$ make
In file included from ../../../../include/old/test.h:51:0,
                 from faccessat01.c:44:
faccessat01.c: In function ‘setup’:
../../../../include/old/old_safe_file_ops.h:55:27:
warning: format not a string literal and no format arguments [-Wformat-security]
                   (path), (fmt), ## __VA_ARGS__)
                           ^
faccessat01.c:132:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’
  SAFE_FILE_PRINTF(cleanup, testfile, testfile);
  ^
../../../../include/old/old_safe_file_ops.h:55:27:
warning: format not a string literal and no format arguments [-Wformat-security]
                   (path), (fmt), ## __VA_ARGS__)
                           ^
faccessat01.c:133:2: note: in expansion of macro ‘SAFE_FILE_PRINTF’
  SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);

Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
---
 testcases/kernel/syscalls/faccessat/faccessat01.c | 4 ++--
 testcases/kernel/syscalls/fchmodat/fchmodat01.c   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/faccessat/faccessat01.c b/testcases/kernel/syscalls/faccessat/faccessat01.c
index 622dfd3..def7fa7 100644
--- a/testcases/kernel/syscalls/faccessat/faccessat01.c
+++ b/testcases/kernel/syscalls/faccessat/faccessat01.c
@@ -129,8 +129,8 @@ void setup(void)
 	fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
 	fds[1] = fds[4] = fds[0];
 
-	SAFE_FILE_PRINTF(cleanup, testfile, testfile);
-	SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
+	SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile);
+	SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2);
 
 	fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
 
diff --git a/testcases/kernel/syscalls/fchmodat/fchmodat01.c b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
index 6bf66d8..7856ed3 100644
--- a/testcases/kernel/syscalls/fchmodat/fchmodat01.c
+++ b/testcases/kernel/syscalls/fchmodat/fchmodat01.c
@@ -127,8 +127,8 @@ void setup(void)
 	fds[0] = SAFE_OPEN(cleanup, pathname, O_DIRECTORY);
 	fds[1] = fds[4] = fds[0];
 
-	SAFE_FILE_PRINTF(cleanup, testfile, testfile);
-	SAFE_FILE_PRINTF(cleanup, testfile2, testfile2);
+	SAFE_FILE_PRINTF(cleanup, testfile, "%s", testfile);
+	SAFE_FILE_PRINTF(cleanup, testfile2, "%s", testfile2);
 
 	fds[2] = SAFE_OPEN(cleanup, testfile3, O_CREAT | O_RDWR, 0600);
 	fds[3] = 100;
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-19 17:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-19 13:31 [LTP] [PATCH] faccessat and fchmodat: Fix build warnings naresh.kamboju
2017-06-19 17:28 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox