From 880a2f6db9e37ef84347a47b15f88bef741c03da Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 20 Mar 2012 20:35:44 +0100 Subject: [PATCH] tests: avoid gcc warnings about argv vs. const initializers * tests/test-posix_spawn1.c (main): Cast to "(char *)" to avoid two warnings about discarding 'const' qualifier from pointer target type. * tests/test-posix_spawn2.c (main): Likewise. --- ChangeLog | 7 +++++++ tests/test-posix_spawn1.c | 2 +- tests/test-posix_spawn2.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 748f09837c..7b67d0f600 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-03-20 Jim Meyering + + tests: avoid gcc warnings about argv vs. const initializers + * tests/test-posix_spawn1.c (main): Cast to "(char *)" to avoid two + warnings about discarding 'const' qualifier from pointer target type. + * tests/test-posix_spawn2.c (main): Likewise. + 2012-03-20 Reuben Thomas README-release: simplify slightly diff --git a/tests/test-posix_spawn1.c b/tests/test-posix_spawn1.c index 9c41039851..5152d5c897 100644 --- a/tests/test-posix_spawn1.c +++ b/tests/test-posix_spawn1.c @@ -75,7 +75,7 @@ fd_safer (int fd) int main () { - char *argv[3] = { "/bin/sh", CHILD_PROGRAM_FILENAME, NULL }; + char *argv[3] = { (char *) "/bin/sh", (char *) CHILD_PROGRAM_FILENAME, NULL }; int ifd[2]; sigset_t blocked_signals; sigset_t fatal_signal_set; diff --git a/tests/test-posix_spawn2.c b/tests/test-posix_spawn2.c index 39479ebea9..e66c9f2561 100644 --- a/tests/test-posix_spawn2.c +++ b/tests/test-posix_spawn2.c @@ -53,7 +53,7 @@ fd_safer (int fd) int main () { - char *argv[3] = { "/bin/sh", CHILD_PROGRAM_FILENAME, NULL }; + char *argv[3] = { (char *) "/bin/sh", (char *) CHILD_PROGRAM_FILENAME, NULL }; int ofd[2]; sigset_t blocked_signals; sigset_t fatal_signal_set; -- 2.39.5