[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/depcomp.sh |
Date: |
Fri, 16 Dec 2022 07:17:19 +0100 |
From: Frédéric Bérat <fberat@redhat.com>
Changes from v1:
Split from [PATCH 2/2]
-- 8< --
In depcomp.sh, the following occurs:
1. Files are created so that headers and units are available in
subdirectories
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
depcomp.sh.
---
t/ax/depcomp.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh
index e4e7565df..a9debc8ef 100644
--- a/t/ax/depcomp.sh
+++ b/t/ax/depcomp.sh
@@ -243,6 +243,7 @@ cat > sub/subfoo.h <<'END'
#include <stdio.h>
extern int subfoo (void);
END
+cp sub/subfoo.h sub/subfoo.save
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/subfoo.save "$srcdir"/sub/subfoo.h \
&& make_ok \
|| r='not ok'
result_ "$r" "$pfx dependency tracking works"
--
2.38.1
- [bug#59992] [PATCH 1/2] tests: Fix 'type defaults' error in link_cond due to main not being properly declared, (continued)
[bug#59993] [PATCH v2 2/3] tests: Fix implicit function declaration errors, Frederic Berat, 2022/12/16
[bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in ax/depcomp.sh,
Frederic Berat <=
[bug#59991] [PATCH 0/2] Port tests to modern C, Karl Berry, 2022/12/12
[bug#59991] [PATCH v2 0/3] Port tests to modern C, Frederic Berat, 2022/12/16