[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors
From: |
Zack Weinberg |
Subject: |
[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors |
Date: |
Mon, 12 Dec 2022 15:18:36 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 |
On 2022-12-12 2:05 AM, Frederic Berat wrote:
This is related to an effort to prepare Automake for future GCC/Clang
versions which set c99 as default standard to be used.
Function should be properly declared prior to use in order to be
compatible with c99 standard.
OK in principle, but ...
--- 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"
These changes don't seem to have anything to do with the patch as
described. They should be submitted separately.
--- a/t/lex-nodist.sh
+++ b/t/lex-nodist.sh
@@ -62,6 +62,8 @@ CLEANFILES = $(nodist_prog_SOURCES)
END
cat > main.c << 'END'
+extern int yylex (void);
+
int main ()
{
return yylex ();
Please change `int main ()` to `int main (void)` as long as you're in here.
--- a/t/ltconv.sh
+++ b/t/ltconv.sh
@@ -91,6 +91,12 @@ echo 'int sub22 () { return 22; }' > sub2/sub22/sub22.c
cat >test.c <<'EOF'
#include <stdio.h>
+
+extern int sub1 (void);
+extern int sub2 (void);
+extern int sub21 (void);
+extern int sub22 (void);
+
int main ()
{
if (1 != sub1 ())
Same here.
--- a/t/yacc-basic.sh
+++ b/t/yacc-basic.sh
@@ -49,6 +49,7 @@ a : 'a' { exit(0); };
END
cat > foo.c << 'END'
+extern int yyparse(void);
int main () { yyparse (); return 1; }
END
And here.
--- a/t/yacc-clean.sh
+++ b/t/yacc-clean.sh
@@ -74,6 +76,8 @@ END
cp sub1/parse.y sub2/parse.y
cat > sub1/main.c << 'END'
+extern int yyparse(void);
+
int main ()
{
return yyparse ();
And here.
--- a/t/yacc-nodist.sh
+++ b/t/yacc-nodist.sh
@@ -78,6 +78,8 @@ BUILT_SOURCES = parse.h
END
cat > sub1/main.c << 'END'
+extern int yyparse(void);
+
int main ()
{
return yyparse ();
And here as well.
[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors, Frederic Berat, 2022/12/12
- [bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors,
Zack Weinberg <=
[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors, Frederic Berat, 2022/12/15
[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors, Zack Weinberg, 2022/12/28
[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, 2022/12/16
[bug#59991] [PATCH 0/2] Port tests to modern C, Karl Berry, 2022/12/12