From: Jim Meyering Date: Tue, 20 Mar 2012 19:35:44 +0000 (+0100) Subject: tests: avoid gcc warnings about argv vs. const initializers X-Git-Tag: v0.1~816 X-Git-Url: http://erislabs.net/gitweb/?p=gnulib.git;a=commitdiff_plain;h=880a2f6db9e37ef84347a47b15f88bef741c03da 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. --- diff --git a/ChangeLog b/ChangeLog index 748f09837..7b67d0f60 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 9c4103985..5152d5c89 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 39479ebea..e66c9f256 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;