* posix_spawn tests: Fix compilation error
@ 2022-11-20 10:13 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2022-11-20 10:13 UTC (permalink / raw
To: bug-gnulib
A testdir for the modules posix_spawn and posix_spawnp fails to compile:
gcc -ftrapv -DHAVE_CONFIG_H -I. -I../../gltests -I.. -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. -I../../gltests/.. -I../gllib -I../../gltests/../gllib -I/media/develdata/devel/inst-x86_64-64/include -Wall -Wno-error -g -O2 -MT test-posix_spawn-open1.o -MD -MP -MF $depbase.Tpo -c -o test-posix_spawn-open1.o ../../gltests/test-posix_spawn-open1.c &&\
mv -f $depbase.Tpo $depbase.Po
../../gltests/test-posix_spawn-open1.c: In function ‘parent_main’:
../../gltests/test-posix_spawn-open1.c:40:57: error: expected ‘}’ before ‘EXEEXT’
40 | #define CHILD_PROGRAM_FILENAME "test-posix_spawn-open1" EXEEXT
| ^~~~~~
../../gltests/test-posix_spawn-open1.c:53:21: note: in expansion of macro ‘CHILD_PROGRAM_FILENAME’
53 | char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
| ^~~~~~~~~~~~~~~~~~~~~~
../../gltests/test-posix_spawn-open1.c:53:19: note: to match this ‘{’
53 | char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
| ^
../../gltests/test-posix_spawn-open1.c:40:57: error: expected ‘)’ before ‘EXEEXT’
40 | #define CHILD_PROGRAM_FILENAME "test-posix_spawn-open1" EXEEXT
| ^~~~~~
../../gltests/test-posix_spawn-open1.c:88:42: note: in expansion of macro ‘CHILD_PROGRAM_FILENAME’
88 | || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
| ^~~~~~~~~~~~~~~~~~~~~~
../../gltests/test-posix_spawn-open1.c:88:33: note: to match this ‘(’
88 | || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
| ^
../../gltests/test-posix_spawn-open1.c:88:21: error: too few arguments to function ‘posix_spawn’
88 | || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
| ^~~~~~~~~~~
In file included from ../gllib/spawn.h:42,
from ../../gltests/test-posix_spawn-open1.c:24:
/usr/include/spawn.h:72:12: note: declared here
72 | extern int posix_spawn (pid_t *__restrict __pid,
| ^~~~~~~~~~~
../../gltests/test-posix_spawn-open1.c:53:9: warning: unused variable ‘argv’ [-Wunused-variable]
53 | char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
| ^~~~
make[3]: *** [Makefile:3753: test-posix_spawn-open1.o] Error 1
This patch fixes it.
2022-11-20 Bruno Haible <bruno@clisp.org>
posix_spawn tests: Fix compilation error (regression 2022-09-14).
* modules/posix_spawn-tests (Makefile.am): Augment DEFS, to define
EXEEXT.
diff --git a/modules/posix_spawn-tests b/modules/posix_spawn-tests
index ee505c0389..7d316c96f6 100644
--- a/modules/posix_spawn-tests
+++ b/modules/posix_spawn-tests
@@ -24,6 +24,7 @@ waitpid
configure.ac:
Makefile.am:
+DEFS += -DEXEEXT=\"@EXEEXT@\"
TESTS += \
test-posix_spawn-open1 \
test-posix_spawn-open2 \
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-20 10:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-20 10:13 posix_spawn tests: Fix compilation error Bruno Haible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).