bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

posix_spawn tests: Fix compilation error


From: Bruno Haible
Subject: posix_spawn tests: Fix compilation error
Date: Sun, 20 Nov 2022 11:13:10 +0100

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 \






reply via email to

[Prev in Thread] Current Thread [Next in Thread]