[Top][All Lists]

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

[bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in a

From: Frederic Berat
Subject: [bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in ax/
Date: Fri, 16 Dec 2022 07:17:19 +0100

From: Frédéric Bérat <>

Changes from v1:
  Split from [PATCH 2/2]

-- 8< --

In, the following occurs:

1. Files are created so that headers and units are available in
2. Multiple "make" are executed, while modifying the content of the
   headers, some should fail, others should succeed.
3. At the end, the "sub/subfoo.h" header gets removed.
4. make is executed again, which is expected to succeed.

Yet, with c99, this can't work as the subfoo.h header contains
declaration that are used by foo.c.
Thus, we need to get them back, either by inserting the declaration in
foo.c (or any other header/unit), or by restoring subfoo.h to its
original state.

The later solution seems the easiest path, being less intrusive in
 t/ax/ | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/ax/ b/t/ax/
index e4e7565df..a9debc8ef 100644
--- a/t/ax/
+++ b/t/ax/
@@ -243,6 +243,7 @@ cat > sub/subfoo.h <<'END'
 #include <stdio.h>
 extern int subfoo (void);
+cp sub/subfoo.h sub/
 cat > src/baz.c <<'END'
 #include "baz.h"
@@ -399,8 +400,7 @@ do_test ()
       && rewrite "$srcdir"/sub/subfoo.h echo 'choke me' \
       && not $MAKE \
       && delete "$srcdir"/sub/subfoo.h \
-      && edit "$srcdir"/sub/subfoo.c -e 1d \
-      && edit "$srcdir"/foo.h -e 2d \
+      && mv  "$srcdir"/sub/ "$srcdir"/sub/subfoo.h \
       && make_ok \
       || r='not ok'
     result_ "$r" "$pfx dependency tracking works"

reply via email to

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