[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors
From: |
Frederic Berat |
Subject: |
[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors |
Date: |
Thu, 15 Dec 2022 17:48:44 +0100 |
On Mon, Dec 12, 2022 at 9:19 PM Zack Weinberg <zack@owlfolio.org> wrote:
>
> 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.
I'm hesitant on this. That isn't the purpose of the patch, and if I
start to do that, there are about 48 files that would need to be
touched (which omit void for empty argument list). Kind of a noisy
change with no real benefit.
But if you insist, I can do the ones in the files I touched.
>
> > --- 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#59992] [PATCH 1/2] tests: Fix 'type defaults' error in link_cond due to main not being properly declared, (continued)
[bug#59992] [PATCH v2 1/3] tests: Fix 'type defaults' error in link_cond due to main not being properly declared, Frederic Berat, 2022/12/16
[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,
Frederic Berat <=
[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
[bug#59991] [PATCH v2 0/3] Port tests to modern C, Frederic Berat, 2022/12/16