1
0
mirror of https://https.git.savannah.gnu.org/git/gnulib.git synced 2026-04-28 06:33:36 +00:00

maint: pacify -Wdiscarded-qualifiers

* tests/test-posix_spawn-dup2-stdin.c (main):
* tests/test-posix_spawn-dup2-stdout.c (main):
* tests/test-posix_spawn-inherit0.c (parent_main):
* tests/test-posix_spawn-inherit1.c (parent_main):
* tests/test-posix_spawn-open1.c (parent_main):
* tests/test-posix_spawn-open2.c (parent_main):
Reword to avoid need to cast string literals to char *,
while also pacifying gcc -Wdiscarded-qualifiers.
This commit is contained in:
Paul Eggert
2026-01-13 08:10:50 -08:00
parent 7d4eeebc74
commit 7606f1f29c
7 changed files with 28 additions and 6 deletions

View File

@@ -1,5 +1,15 @@
2026-01-13 Paul Eggert <eggert@cs.ucla.edu>
maint: pacify -Wdiscarded-qualifiers
* tests/test-posix_spawn-dup2-stdin.c (main):
* tests/test-posix_spawn-dup2-stdout.c (main):
* tests/test-posix_spawn-inherit0.c (parent_main):
* tests/test-posix_spawn-inherit1.c (parent_main):
* tests/test-posix_spawn-open1.c (parent_main):
* tests/test-posix_spawn-open2.c (parent_main):
Reword to avoid need to cast string literals to char *,
while also pacifying gcc -Wdiscarded-qualifiers.
trunc-tests: pacify -Wmissing-prototypes
* tests/test-trunc2.c (trunc_reference): Now static.

View File

@@ -50,7 +50,9 @@ fd_safer (int fd)
int
main ()
{
char *argv[3] = { (char *) BOURNE_SHELL, (char *) CHILD_PROGRAM_FILENAME, NULL };
char argv0[] = BOURNE_SHELL;
char argv1[] = CHILD_PROGRAM_FILENAME;
char *argv[] = { argv0, argv1, NULL };
int ofd[2];
sigset_t blocked_signals;
sigset_t fatal_signal_set;

View File

@@ -72,7 +72,9 @@ fd_safer (int fd)
int
main ()
{
char *argv[3] = { (char *) BOURNE_SHELL, (char *) CHILD_PROGRAM_FILENAME, NULL };
char argv0[] = BOURNE_SHELL;
char argv1[] = CHILD_PROGRAM_FILENAME;
char *argv[] = { argv0, argv1, NULL };
int ifd[2];
sigset_t blocked_signals;
sigset_t fatal_signal_set;

View File

@@ -38,7 +38,9 @@ static int
parent_main (void)
{
FILE *fp;
char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
char argv0[] = CHILD_PROGRAM_FILENAME;
char argv1[] = "-child";
char *argv[] = { argv0, argv1, NULL };
int err;
pid_t child;
int status;

View File

@@ -38,7 +38,9 @@ static int
parent_main (void)
{
FILE *fp;
char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
char argv0[] = CHILD_PROGRAM_FILENAME;
char argv1[] = "-child";
char *argv[] = { argv0, argv1, NULL };
int err;
pid_t child;
int status;

View File

@@ -50,7 +50,9 @@ static int
parent_main (void)
{
FILE *fp;
char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
char argv0[] = CHILD_PROGRAM_FILENAME;
char argv1[] = "-child";
char *argv[] = { argv0, argv1, NULL };
posix_spawn_file_actions_t actions;
bool actions_allocated;
int err;

View File

@@ -38,7 +38,9 @@ static int
parent_main (void)
{
FILE *fp;
char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
char argv0[] = CHILD_PROGRAM_FILENAME;
char argv1[] = "-child";
char *argv[] = { argv0, argv1, NULL };
posix_spawn_file_actions_t actions;
bool actions_allocated;
int err;