[bug#68416] [PATCH] python: add 3.20 - 3.16 to the version search list

2024-01-14 Thread Frederic Berat
On Sun, Jan 14, 2024 at 3:13 AM Karl Berry  wrote:

> With Python 3.12 out now, and 3.13 out in ~9 months, the existing
> runway
> is running out.  Bump up to 3.20 for the next Automake release.
>
> Applied, thanks.
>
> Not proposing to try anything for our upcoming release, but I wonder if
> there is some more general way to handle Python versions? We don't have
> to laboriously list every possible version for anything else.
>

That may not be the most clever way to do it, but you can probably build
the list dynamically at least, with something like (untested):

pythons="python python2 python3"
for i in {20..0};do pythons="$pythons python3.$i";done
for i in {7..0};do pythons="$pythons python2.$i";done

m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [$pythons])


> As things are, I'm tempted to include 4.20-4.1 too, because their next
> major incompatibility will probably come sooner rather than later ...
>
> wdyt? --thanks, karl.
>
>
>
>


Re: [platform-testers] automake-1.16j pretest available: please test

2024-01-05 Thread Frederic Berat
On Fri, Dec 29, 2023 at 6:14 PM Karl Berry  wrote:

> The GNU Automake 1.16j development snapshot is now available. Download
> here:
>
>   https://alpha.gnu.org/gnu/automake/automake-1.16j.tar.xz
>   https://alpha.gnu.org/gnu/automake/automake-1.16j.tar.gz
>
> Hello,

No major issue found during my mass rebuild against dependent packages on
Fedora-rawhide.

LGTM.


> We intend for automake 1.17 to be released soon, essentially with only
> bug fixes for whatever is found in this pretest. So please do test if at
> all possible.
>
> The main change from 1.16i was another attempt at making the "subsecond
> mtime" support reliable and backward compatible. That is, to work with
> autoconf-2.72 (which supports subsecond mtimes) and earlier versions
> (which don't). See below for the detailed list of changes since the
> previous version, as summarized by the NEWS file.
>
> In general, it's our primary goal to preserve compatibility. If this
> release of Automake induces failure in a setup that was previously
> working, please let us know.
>
> Please report bugs and problems to ,
> and send general comments and feedback to ,
> and patches to .
>
> Thanks to everyone who has reported problems, contributed patches,
> and helped test Automake!
>
> With special thanks to Bogdan, Mike Frysinger, Nick Bowler, and
> Zack Weinberg for their numerous contributions.  This release could not
> have happened without them.
>
>
> 
>
> New in (what will be) 1.17:
>
> * New features added
>
>   - AM_PATH_PYTHON will, after checking "python", prefer any Python 3
> version (latest versions checked first) over any Python 2
> version. If a specific version of Python 2 is still needed, the
> $PYTHON variable should be set beforehand.
>
>   - AM_PATH_PYTHON will also search for Python versions 3.15 through 3.10.
> It previously searched for 3.9 through 3.0. (bug#53530)
>
>   - RANLIB may be overridden on a per-target basis.
>
>   - AM_TEXI2FLAGS may be defined to pass extra flags to TEXI2DVI &
> TEXI2PDF.
>
>   - New option "posix" to emit the special target .POSIX for make.
>
>   - Systems with non-POSIX "rm -f" behavior are now supported, and the
> prior intent to drop support for them has been reversed.
> The ACCEPT_INFERIOR_RM_PROGRAM setting no longer exists.
>
>   - Variables using escaped \# will trigger portability warnings, but be
> retained when appended.  GNU Make & BSD Makes are known to support it.
> (bug#7610)
>
>   - GNU Make's default pattern rules are disabled, for speed and debugging.
> (.SUFFIXES was already cleared.) (bug#64743)
>
>   - For Texinfo documents, if a .texi.in file exists, but no .texi, the
> .texi.in will be read. Texinfo source files need not be present at
> all, and if present, need not contain @setfilename. Then the file name
> as given in the Makefile.am will be used.  If @setfilename is present,
> it should be the basename of the Texinfo file, extended with .info.
> (bug#54063)
>
>   - The missing script also supports autoreconf, autogen, and perl.
>
> * Bugs fixed
>
>   - Generated file timestamp checks handle filesystems with sub-second
> timestamp granularity dynamically, greatly speeding up make check,
> etc. However, this requires an autom4te from Autoconf 2.72 or later
> (or random test failures and other timing problems may ensue), as
> well as a Perl, sleep utility, and filesystem that supports
> sub-second resolution; otherwise, we fall back to one-second
> granularity as before. When everything is supported, a line
> `Features: subsecond-mtime' is now printed by automake --version
> and autom4te --version. (bug#64756, bug#67670)
>
>   - The default value of $ARFLAGS is now "cr" instead of "cru", to better
> support deterministic builds. (bug#20082)
>
>   - Dependency files are now empty, instead of '# dummy', for speed.
>
>   - Compiling Python modules with Python 3.5+ uses multiple optimization
> levels. (bug#38043)
>
>   - When compiling Emacs Lisp files, emacs is run with --no-site-file to
> disable user config files that might hang or access the terminal;
> and -Q is not used, since its support and behavior varies. (bug#58102)
>
>   - Emacs Lisp compilations respects silent make output.
>
>   - Automake no longer incorrectly warns that the POSIX make variables
> $(*D) and the like are non-POSIX. Unfortunately, the make
> implementations which do not correctly implement all the POSIX
> variables are not detected, but this seems to have little impact
> in practice. (bug#9587)
>
>   - Pass libtool tags OBJC and OBJCXX for the respective languages.
> (bug#67539)
>
>   - distcleancheck ignores "silly rename" files (.nfs* .smb* .__afs*)
> that can show up on network file systems.
>
>   - tests: avoid some declaration conflicts for lex et al. on SunOS.
> (bug#34151 and others)
>
>   - 

Re: [platform-testers] automake-1.16i pretest available: please test

2023-12-19 Thread Frederic Berat
On Mon, Dec 18, 2023 at 10:32 PM Karl Berry  wrote:

> We are pleased to announce the GNU Automake 1.16i development snapshot.
> We intend for automake 1.17 to be released soon, essentially with only
> bug fixes for whatever is found in this pretest. So please do test if at
> all possible.
>
> It's our primary goal to preserve compatibility. If this release of
> Automake induces failure in a setup that was previously working, please
> let us know.
>
> See below for the detailed list of changes since the
> previous version, as summarized by the NEWS file.
>
> Download here:
>
>   https://alpha.gnu.org/gnu/automake/automake-1.16i.tar.xz
>   https://alpha.gnu.org/gnu/automake/automake-1.16i.tar.gz
>
>
Hello,

I ran `make check` for this release on Fedora-rawhide and got random
failures. Multiple runs seem to show different failures on all arches we
support, while no failures are reported with the previous release.
Failure reported so far are:
t/aclocal-autoconf-version-check
t/backcompat2
t/backcompat3
t/nodef
t/nodef2
t/remake-aclocal-version-mismatch
t/silent-defaults
t/subdir-add2-pr46
t/testsuite-summary-reference-log

Logs can be found here (check builder-live.log.gz):
https://copr.fedorainfracloud.org/coprs/fberat/automake-1.16i/build/6769645/

Fred.


Re: rhel8 test failure confirmation?

2023-03-06 Thread Frederic Berat
Hello,

I spent some more time on testing, and I could reproduce the issue on
Fedora rawhide, which gives more freedom for reproduction.

Regarding what I said earlier, since that wasn't clear enough, I couldn't
reproduce `make check` failures with the 1.16.5 official taball in a mock
environment, only with the trunk.
After few more hours, I could isolate 2 cases:
1) Random failures from multiple tests as stated earlier
2) Spurious failures of subobj.sh

Regarding 1), bisection led to 720a1153134b833de9298927a432b4ea266216fb
"m4: speed up filesystem modification checks". Whether it creates the
problem or simply reveals it is yet unclear. With this patch I could
reproduce multiple failures relatively easily (rarely more than one run).
Once reverted, the only test that fails from time to time on my side is
"subobj.sh" (twice out of ten trials). The amount of trials is probably not
enough, but based on previous observations, this patch looks to be a good
candidate for more investigations.

Regarding 2), that's less clear as this one fails less often, more time
would be needed to bisect it.

Fred.

On Sun, Mar 5, 2023 at 10:32 PM Bogdan  wrote:

> Karl Berry , Sat Mar 04 2023 00:00:56 GMT+0100
> (Central European Standard Time)
> >  Note that 'config.h' is older (4 seconds) than './configure', which
> >  shouldn't be the case as it should get updated with new values.
> >
> > Indeed. That is the same sort of thing as I was observing with nodef.
> > But what (at any level) could be causing that to happen?
> > Files just aren't getting updated as they should be.
> >
> > I haven't yet tried older releases of automake to see if their tests
> > succeed on the systems that are failing now. That's next on my list.
>
> [...]
>
>
>   Another tip, maybe: cache again. When I compare which files are
> newer than the only trace file I get in the failing 'backcompat2' test
> ('autom4te.cache/traces.0'), I see that 'configure.ac' is older than
> this file in the succeeding run, but it's newer in the failing run.
> This could explain why 'configure' doesn't get updated to put new
> values in config.h (in my case) - 'autom4te' thinks it's up-to-date.
>   The root cause may be in 'autom4te', sub 'up_to_date':
>
># The youngest of the cache files must be older than the oldest of
># the dependencies.
># FIXME: These timestamps have only 1-second resolution.
># Time::HiRes fixes this, but assumes Perl 5.8 or later.
>
> (lines 913-916 in my version).
>
>   Perhaps 'configure.ac' in the case that fails is created "not late
> enough" (still within 1 second) when compared to the cache, and the
> cached values are taken, generating the old version of 'configure'
> which, in turn, generates old versions of the output files.
>
>   Still a guess, but maybe a bit more probable now.
>
>   Does it work when you add '-f' to '$AUTOCONF'? It does for me -
> again, about 20 sequential runs of the same set of tests and about 5
> parallel with 4 threads. Zero failures.
>   I'd probably get the same result if I did a 'rm -fr autom4te.cache'
> before each '$AUTOCONF' invocation.
>
>   If it does work for you, then maybe it would be better to add '-f'
> to the 'AUTOCONF' variable where it's defined? Tests with a single
> '$AUTOCONF' invocation won't notice (they will create their cache
> anyway), while tests with multiple calls can maybe get fixed all at once.
>
>   And I take back that the problem doesn't arise when I call the
> single test. I just wasn't "lucky enough". Got a failure now (without
> the fix), in the 7th attempt, while 40 or 60 (I did batches of 20)
> earlier succeeded (with the fix, of course).
>
>   So, maybe it's not a problem of a NEW system by itself, just a
> FASTER system + 1-second resolution in 'autom4te'.
>
> --
> Regards - Bogdan ('bogdro') D. (GNU/Linux & FreeDOS)
> X86 assembly (DOS, GNU/Linux):http://bogdro.evai.pl/index-en.php
> Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
> www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
>
>
>


Re: rhel8 test failure confirmation?

2023-03-06 Thread Frederic Berat
Oh, and I forgot, regarding autoconf: the RHEL 8 image I tested with had
autoconf 2.69. Failures could be detected with automake trunk, not with
official tarball (at least so far).

On Mon, Mar 6, 2023 at 11:19 PM Frederic Berat  wrote:

> Hello,
>
> I spent some more time on testing, and I could reproduce the issue on
> Fedora rawhide, which gives more freedom for reproduction.
>
> Regarding what I said earlier, since that wasn't clear enough, I couldn't
> reproduce `make check` failures with the 1.16.5 official taball in a mock
> environment, only with the trunk.
> After few more hours, I could isolate 2 cases:
> 1) Random failures from multiple tests as stated earlier
> 2) Spurious failures of subobj.sh
>
> Regarding 1), bisection led to 720a1153134b833de9298927a432b4ea266216fb
> "m4: speed up filesystem modification checks". Whether it creates the
> problem or simply reveals it is yet unclear. With this patch I could
> reproduce multiple failures relatively easily (rarely more than one run).
> Once reverted, the only test that fails from time to time on my side is
> "subobj.sh" (twice out of ten trials). The amount of trials is probably not
> enough, but based on previous observations, this patch looks to be a good
> candidate for more investigations.
>
> Regarding 2), that's less clear as this one fails less often, more time
> would be needed to bisect it.
>
> Fred.
>
> On Sun, Mar 5, 2023 at 10:32 PM Bogdan  wrote:
>
>> Karl Berry , Sat Mar 04 2023 00:00:56 GMT+0100
>> (Central European Standard Time)
>> >  Note that 'config.h' is older (4 seconds) than './configure', which
>> >  shouldn't be the case as it should get updated with new values.
>> >
>> > Indeed. That is the same sort of thing as I was observing with nodef.
>> > But what (at any level) could be causing that to happen?
>> > Files just aren't getting updated as they should be.
>> >
>> > I haven't yet tried older releases of automake to see if their tests
>> > succeed on the systems that are failing now. That's next on my list.
>>
>> [...]
>>
>>
>>   Another tip, maybe: cache again. When I compare which files are
>> newer than the only trace file I get in the failing 'backcompat2' test
>> ('autom4te.cache/traces.0'), I see that 'configure.ac' is older than
>> this file in the succeeding run, but it's newer in the failing run.
>> This could explain why 'configure' doesn't get updated to put new
>> values in config.h (in my case) - 'autom4te' thinks it's up-to-date.
>>   The root cause may be in 'autom4te', sub 'up_to_date':
>>
>># The youngest of the cache files must be older than the oldest of
>># the dependencies.
>># FIXME: These timestamps have only 1-second resolution.
>># Time::HiRes fixes this, but assumes Perl 5.8 or later.
>>
>> (lines 913-916 in my version).
>>
>>   Perhaps 'configure.ac' in the case that fails is created "not late
>> enough" (still within 1 second) when compared to the cache, and the
>> cached values are taken, generating the old version of 'configure'
>> which, in turn, generates old versions of the output files.
>>
>>   Still a guess, but maybe a bit more probable now.
>>
>>   Does it work when you add '-f' to '$AUTOCONF'? It does for me -
>> again, about 20 sequential runs of the same set of tests and about 5
>> parallel with 4 threads. Zero failures.
>>   I'd probably get the same result if I did a 'rm -fr autom4te.cache'
>> before each '$AUTOCONF' invocation.
>>
>>   If it does work for you, then maybe it would be better to add '-f'
>> to the 'AUTOCONF' variable where it's defined? Tests with a single
>> '$AUTOCONF' invocation won't notice (they will create their cache
>> anyway), while tests with multiple calls can maybe get fixed all at once.
>>
>>   And I take back that the problem doesn't arise when I call the
>> single test. I just wasn't "lucky enough". Got a failure now (without
>> the fix), in the 7th attempt, while 40 or 60 (I did batches of 20)
>> earlier succeeded (with the fix, of course).
>>
>>   So, maybe it's not a problem of a NEW system by itself, just a
>> FASTER system + 1-second resolution in 'autom4te'.
>>
>> --
>> Regards - Bogdan ('bogdro') D. (GNU/Linux & FreeDOS)
>> X86 assembly (DOS, GNU/Linux):http://bogdro.evai.pl/index-en.php
>> Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
>> www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
>>
>>
>>


Re: rhel8 test failure confirmation?

2023-03-02 Thread Frederic Berat
Hello,

For the record, I made a first run of testing on a rhel 8 system.
While building the trunk directly led to check failures, rebuilding the RPM
in a mock environment didn't.

I'll likely spend more time next week to perform more testing. It may
simply be an environment problem: I noticed the RPM buildrequires weren't
enough to execute bootstrap, there may be more to that.


Frédéric Bérat

Red Hat -  Platform Tools
https://www.redhat.com

On Wed, Mar 1, 2023 at 10:55 PM Karl Berry  wrote:

>   FAIL: t/remake-aclocal-version-mismatch.sh
>
> Thanks for trying it, Nick.
> I'm glad it's not just me.
> And I sure wonder wtf is going on :(. -k
>
>


[bug#59991] [PATCH v2 0/3] Port tests to modern C

2023-02-06 Thread Frederic Berat
Yes, they got separated bug IDs, next time I should probably consider
modifying the patch headers so that they are sent in reply to the cover
letter.

The first patch has been merged (
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59992).
The second has been divided in 2:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59993#23
and
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=60962 (I replied to the wrong
message when sending the v3)

Fred.




On Sat, Feb 4, 2023 at 11:29 PM Karl Berry  wrote:

> However, neither in this mail, nor in your original did I find a
> corresponding patch.
>
> Hi Jim - they ended up with separate bug#s, since separate emails.
> At least I think these are those:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59992 (applied by mike?)
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59993
>
> BTW, see also the next bug,
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59994
> for more from Frederic, about flex madness.
>
> karl
>
>


[bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in ax/depcomp.sh

2023-01-16 Thread Frederic Berat
I'm still investigating this failure.

So far I could find 2 similar scenarios, both based on 1.16.5 with the
patch, but one that fails, and the other that succeeds, seemingly
consistently.
Case 1: using the 1.16.5 tarball + the patch applied, automake is built and
tested within fedora environment (with specific env variables and flags
...), the test seems to pass consistently.
Case 2: using the 1.16.5 tarball + the patch applied, I distclean,
bootstrap, reconfigure (using same configure command as case 1) and build
manually, the test seems to fail consistently.
Both builds are run within the same chroot.

In the failure case, foo.o doesn't get rebuilt when the header is restored
to its original state, whereas the header is listed in the foo.Tpo file.
Since foo.o isn't rebuilt, the foo.Tpo file isn't moved to foo.Po, which
leads to the test failure.

I'm trying to figure out why in one case foo.o is consistently rebuilt,
while not in the other.

On Fri, Jan 13, 2023 at 10:57 AM Frederic Berat  wrote:

> Ok, I'll try to figure out why this test passes on 1.16.5 but not on HEAD
> with the same patch.
>
> On Fri, Jan 13, 2023 at 9:47 AM Mike Frysinger  wrote:
>
>> On 13 Jan 2023 09:14, Frederic Berat wrote:
>> > I made one more build with a different patchset list, could it be that
>> the
>> > failure you encounter is with "t/subobj.sh" ?
>>
>> to be clear, i applied this patch only to current git master.  i didn't
>> try
>> including anything else.  with that in mind, the failure is not in that,
>> but
>> in t/depcomp-auto.tap.
>> FAIL: t/depcomp-auto
>> FAIL: t/depcomp-auto.tap 14 - [simple VPATH] make distclean
>> FAIL: t/depcomp-auto.tap 21 - [long VPATH] make distclean
>> FAIL: t/depcomp-auto.tap 28 - [absolute VPATH] make distclean
>>
>> ERROR: files left in build directory after distclean:
>> ./.deps/foo.Tpo
>> make: *** [Makefile:750: distcleancheck] Error 1
>> -mike
>>
>


[bug#59994] [PATCH] tests: Don't try to prevent flex to include unistd.h

2023-01-13 Thread Frederic Berat
I probably won't be able to do so before next week at least.
If you happen to have time (and be willing) to do it earlier, don't
hesitate ;)

On Fri, Jan 13, 2023 at 7:31 AM Mike Frysinger  wrote:

> On Mon, 12 Dec 2022 15:20:46 -0500, Zack Weinberg wrote:
> > On 2022-12-12 2:07 AM, Frederic Berat wrote:
> > >
> > > This patch is mainly a proposal. While the macro can simply be removed
> > > as explained below, another possibility it to add a flex option
> > > "--never-interactive" to prevent flex to make use of "isatty".
> > >
> > > This is related to an effort to prepare Automake for future GCC/Clang
> > > versions which set c99 as default standard to be used.
> > >
> > > Future version of flex make the "NO_UNISTD" flag a no-op, and include
> > > unistd.h by default.
> > >
> > > In current version of flex, not having this header leads to implicit
> > > function declarations that are not compatible with c99 standard.
> > >
> > > On top of that, while flex dedicated test were having this macro set,
> > > the yacc ones didn't have it despise their use of Flex. Thus, if this
> > > macro was ever useful, it looks like nobody actually cared.
> >
> > I'm guessing that the idea here was to avoid using unistd.h on platforms
> > that don't supply that header at all.  I suggest that we should apply
> > your patch *and* consistently test flex with "--never-interactive".
>
> sounds fine.  want to update your patch Frederic ?
> -mike
>
>
>
>


[bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in ax/depcomp.sh

2023-01-13 Thread Frederic Berat
Ok, I'll try to figure out why this test passes on 1.16.5 but not on HEAD
with the same patch.

On Fri, Jan 13, 2023 at 9:47 AM Mike Frysinger  wrote:

> On 13 Jan 2023 09:14, Frederic Berat wrote:
> > I made one more build with a different patchset list, could it be that
> the
> > failure you encounter is with "t/subobj.sh" ?
>
> to be clear, i applied this patch only to current git master.  i didn't try
> including anything else.  with that in mind, the failure is not in that,
> but
> in t/depcomp-auto.tap.
> FAIL: t/depcomp-auto
> FAIL: t/depcomp-auto.tap 14 - [simple VPATH] make distclean
> FAIL: t/depcomp-auto.tap 21 - [long VPATH] make distclean
> FAIL: t/depcomp-auto.tap 28 - [absolute VPATH] make distclean
>
> ERROR: files left in build directory after distclean:
> ./.deps/foo.Tpo
> make: *** [Makefile:750: distcleancheck] Error 1
> -mike
>


[bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in ax/depcomp.sh

2023-01-13 Thread Frederic Berat
I made one more build with a different patchset list, could it be that the
failure you encounter is with "t/subobj.sh" ?

In my tests run this failure is fixed by:
https://lists.gnu.org/archive/html/automake-patches/2022-12/msg1.html

On Fri, Jan 13, 2023 at 8:57 AM Frederic Berat  wrote:

> That's strange, although I tested it on top of automake-1.16.5, I don't
> have any failure on `make check` with this one here [1].
>
> May you provide more details ?
>
>
> [1]
>
> 
> Testsuite summary for GNU Automake 1.16.5
>
> 
> # TOTAL: 2980
> # PASS:  2882
> # SKIP:  60
> # XFAIL: 38
> # FAIL:  0
> # XPASS: 0
> # ERROR: 0
>
> 
>
> On Fri, Jan 13, 2023 at 7:48 AM Mike Frysinger  wrote:
>
>> this breaks `make check`, so i can't merge it
>> -mike
>>
>>


[bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in ax/depcomp.sh

2023-01-12 Thread Frederic Berat
That's strange, although I tested it on top of automake-1.16.5, I don't
have any failure on `make check` with this one here [1].

May you provide more details ?


[1]

Testsuite summary for GNU Automake 1.16.5

# TOTAL: 2980
# PASS:  2882
# SKIP:  60
# XFAIL: 38
# FAIL:  0
# XPASS: 0
# ERROR: 0


On Fri, Jan 13, 2023 at 7:48 AM Mike Frysinger  wrote:

> this breaks `make check`, so i can't merge it
> -mike
>
>


[bug#59991] [PATCH v2 0/3] Port tests to modern C

2022-12-15 Thread Frederic Berat
From: Frédéric Bérat 

Hello,

There is ongoing work from both GCC and Clang community to set the C99 standard
as the default one.
In this context, Fedora packages were rebuilt with some warnings turned as
errors to simulate the change. This leads to failures in Automake, that are
attempted to be fixed, mainly in this patchset.

Fred.

Changes from v1:
  - [PATCH 2/2] has been split in 2, in order to properly detail changes
related to depcomp.sh. The code is untouched.

---
Frédéric Bérat (3):
  tests: Fix 'type defaults' error in link_cond due to main not being
properly declared
  tests: Fix implicit function declaration errors
  tests: Fix implicit function declaration in ax/depcomp.sh

 t/ax/depcomp.sh  |  4 ++--
 t/c-demo.sh  |  1 +
 t/cond35.sh  |  2 ++
 t/dist-vs-built-sources.sh   |  1 +
 t/lex-clean.sh   |  1 +
 t/lex-multiple.sh|  4 
 t/lex-nodist.sh  |  2 ++
 t/link_cond.sh   |  2 +-
 t/ltcond2.sh |  2 ++
 t/ltconv.sh  |  6 ++
 t/subobj-clean-lt-pr10697.sh | 10 +-
 t/subobj-clean-pr10697.sh| 10 +-
 t/tags-pr12372.sh|  3 ++-
 t/yacc-basic.sh  |  1 +
 t/yacc-clean.sh  |  4 
 t/yacc-nodist.sh |  2 ++
 16 files changed, 49 insertions(+), 6 deletions(-)

-- 
2.38.1






[bug#59993] [PATCH v2 2/3] tests: Fix implicit function declaration errors

2022-12-15 Thread Frederic Berat
From: Frédéric Bérat 

Changes from v1:
  Modifications to "t/ax/depcomp.sh" have been moved to a dedicated patch

-- 8< --

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.
This is valid for both local functions and standard functions (as
printf).

Modified files:

 * t/c-demo.sh
 * t/cond35.sh
 * t/dist-vs-built-sources.sh
 * t/lex-clean.sh
 * t/lex-multiple.sh
 * t/lex-nodist.sh
 * t/ltcond2.sh
 * t/ltconv.sh
 * t/subobj-clean-lt-pr10697.sh
 * t/subobj-clean-pr10697.sh
 * t/tags-pr12372.sh
 * t/yacc-basic.sh
 * t/yacc-clean.sh
 * t/yacc-nodist.sh
---
 t/c-demo.sh  |  1 +
 t/cond35.sh  |  2 ++
 t/dist-vs-built-sources.sh   |  1 +
 t/lex-clean.sh   |  1 +
 t/lex-multiple.sh|  4 
 t/lex-nodist.sh  |  2 ++
 t/ltcond2.sh |  2 ++
 t/ltconv.sh  |  6 ++
 t/subobj-clean-lt-pr10697.sh | 10 +-
 t/subobj-clean-pr10697.sh| 10 +-
 t/tags-pr12372.sh|  3 ++-
 t/yacc-basic.sh  |  1 +
 t/yacc-clean.sh  |  4 
 t/yacc-nodist.sh |  2 ++
 14 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/t/c-demo.sh b/t/c-demo.sh
index 7e0e8d64f..d25bf214b 100644
--- a/t/c-demo.sh
+++ b/t/c-demo.sh
@@ -113,6 +113,7 @@ test -f build-aux/compile # We have per-target flags on C 
sources.
 ./configure --enable-dependency-tracking
 
 cat > src/main.c << 'END'
+#include 
 #include "foo.h"
 #include "bar.h"
 int main (void)
diff --git a/t/cond35.sh b/t/cond35.sh
index 215a22548..bad133970 100644
--- a/t/cond35.sh
+++ b/t/cond35.sh
@@ -73,6 +73,8 @@ END
 
 cat > tparse.y << 'END'
 %{
+extern int yylex(void);
+
 void yyerror (const char *s) {}
 %}
 %token EOF
diff --git a/t/dist-vs-built-sources.sh b/t/dist-vs-built-sources.sh
index d038e66dd..db2776f9a 100644
--- a/t/dist-vs-built-sources.sh
+++ b/t/dist-vs-built-sources.sh
@@ -41,6 +41,7 @@ foo_SOURCES = foo.c
 END
 
 cat > foo.c << 'END'
+#include 
 #include "h.h"
 int main (void) { printf ("%s\n", F); return 0; }
 END
diff --git a/t/lex-clean.sh b/t/lex-clean.sh
index 5aa199338..e53da8fd2 100644
--- a/t/lex-clean.sh
+++ b/t/lex-clean.sh
@@ -61,6 +61,7 @@ cat > lexer.l << 'END'
 END
 
 cat > main.c << 'END'
+extern int yylex (void);
 int main (void)
 {
   return yylex ();
diff --git a/t/lex-multiple.sh b/t/lex-multiple.sh
index 2655b633e..bf119ec84 100644
--- a/t/lex-multiple.sh
+++ b/t/lex-multiple.sh
@@ -56,6 +56,10 @@ cat > main.c << 'END'
 #include 
 #include 
 
+extern int yylex (void);
+extern int foolex (void);
+extern int bar_lex (void);
+
 int main (int argc, char *argv[])
 {
   if (argc != 2)
diff --git a/t/lex-nodist.sh b/t/lex-nodist.sh
index 599539405..187dd5437 100644
--- 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 ();
diff --git a/t/ltcond2.sh b/t/ltcond2.sh
index 29244c9b3..7e7bcadc4 100644
--- a/t/ltcond2.sh
+++ b/t/ltcond2.sh
@@ -73,6 +73,8 @@ void print (void)
 END
 
 cat > main.c <<'END'
+extern void print(void);
+
 int main (void)
 {
   print();
diff --git a/t/ltconv.sh b/t/ltconv.sh
index 2c4cc47a1..ec79ef80e 100644
--- 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 
+
+extern int sub1 (void);
+extern int sub2 (void);
+extern int sub21 (void);
+extern int sub22 (void);
+
 int main ()
 {
   if (1 != sub1 ())
diff --git a/t/subobj-clean-lt-pr10697.sh b/t/subobj-clean-lt-pr10697.sh
index bb656c43f..53fc02f09 100644
--- a/t/subobj-clean-lt-pr10697.sh
+++ b/t/subobj-clean-lt-pr10697.sh
@@ -83,7 +83,15 @@ libfoo_la_SOURCES = \
 END
 
 mkdir sub1 sub2
-echo 'int libmain (void)' > main.c
+
+echo "/* Subobj clean: libtool case*/" > main.c
+for i in 1 2; do
+  for j in a b c d e f; do
+echo "extern void $j$i (void);" >> main.c
+  done
+done
+
+echo 'int libmain (void)' >> main.c
 echo '{' >> main.c
 for i in 1 2; do
   for j in a b c d e f; do
diff --git a/t/subobj-clean-pr10697.sh b/t/subobj-clean-pr10697.sh
index f77de8c92..a7f97f6d1 100644
--- a/t/subobj-clean-pr10697.sh
+++ b/t/subobj-clean-pr10697.sh
@@ -81,7 +81,15 @@ foo_SOURCES = \
 END
 
 mkdir sub1 sub2
-echo 'int main (void)' > main.c
+
+echo "/* Subobj clean: generic case*/" > main.c
+for i in 1 2; do
+  for j in a b c d e f; do
+echo "extern void $j$i (void);" >> main.c
+  done
+done
+
+echo 'int main (void)' >> main.c
 echo '{' >> main.c
 for i in 1 2; do
   for j in a b c d e f; do
diff --git a/t/tags-pr12372.sh b/t/tags-pr12372.sh
index b9c022f70..1a9e1e026 100644
--- a/t/tags-pr12372.sh
+++ b/t/tags-pr12372.sh
@@ -53,7 +53,8 @@ noinst_PROGRAMS = zap
 zap_SOURCES = zardoz.pc
 END
 
-echo 'int main(void) [ return bar(1); ]' 

[bug#59992] [PATCH v2 1/3] tests: Fix 'type defaults' error in link_cond due to main not being properly declared

2022-12-15 Thread Frederic Berat
From: Frédéric Bérat 

No modifications from v1

-- 8< --

This is related to an effort to prepare Automake for future GCC/Clang
versions which set c99 as default standard to be used.
Not properly declaring main as "int main(...)" is rejected since c99.
---
 t/link_cond.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/link_cond.sh b/t/link_cond.sh
index e7a13b614..533e359e2 100644
--- a/t/link_cond.sh
+++ b/t/link_cond.sh
@@ -52,7 +52,7 @@ $AUTOCONF
 rm -f *.c++
 cat > less.c <<'END'
 /* Valid C but deliberately invalid C++ */
-main ()
+int main (void)
 {
   int new = 0;
   return new;
-- 
2.38.1






[bug#59993] [PATCH v2 3/3] tests: Fix implicit function declaration in ax/depcomp.sh

2022-12-15 Thread Frederic Berat
From: Frédéric Bérat 

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 
 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#59993] [PATCH 2/2] tests: Fix implicit function declaration errors

2022-12-15 Thread Frederic Berat
On Mon, Dec 12, 2022 at 9:19 PM Zack Weinberg  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 
> >   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 
> > +
> > +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

2022-12-14 Thread Frederic Berat
For the record:

cat > less.c <<'END'
/* Valid C but deliberately invalid C++ */
int main (void)
{
  int new = 0;
  return new;
}
END

$> g++ less.c
less.c: In function ‘int main()’:
less.c:4:7: error: expected unqualified-id before ‘new’
4 |   int new = 0;
  |   ^~~
less.c:5:13: error: expected type-specifier before ‘;’ token
5 |   return new;
  | ^


On Tue, Dec 13, 2022 at 7:35 AM Frederic Berat  wrote:
>
> On Mon, Dec 12, 2022 at 9:15 PM Zack Weinberg  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.
> > > Not properly declaring main as "int main(...)" is rejected since c99.
> > ...
> > >   /* Valid C but deliberately invalid C++ */
> > > -main ()
> > > +int main (void)
> >
> > Note the comment.  Is this test program still invalid C++ after your change?
>
> I assumed yes, since "new" should be a standard symbol, but I actually
> forgot to double check.
>
> >
> > zw
> >
> >
> >
> >






[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors

2022-12-13 Thread Frederic Berat
I'll separe this one in a dedicated patch and give it a more
detailed/specific explanation.

On Tue, Dec 13, 2022 at 10:02 PM Zack Weinberg  wrote:
>
> On Tue, Dec 13, 2022, at 1:30 AM, Frederic Berat wrote:
> > On Mon, Dec 12, 2022 at 9:19 PM Zack Weinberg  wrote:
> >> > --- a/t/ax/depcomp.sh
> >> > +++ b/t/ax/depcomp.sh
> >> > @@ -243,6 +243,7 @@ cat > sub/subfoo.h <<'END'
> >> >   #include 
> >> >   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.
> >
> > Actually, that is related. The edit removes the "#include subfoo.h"
> > line from foo.h, because the subfoo.h file got overwritten earlier.
> > This subfoo.h is the one that had the function declaration in ("extern
> > int subfoo (void);" specifically).
> > Either you need the original header back, or you need to get the
> > declaration back another way. I felt this way was easier than trying
> > to insert a declaration without breaking the test.
>
> OK, I clearly don't understand what this test is doing, so I'm going to
> defer to someone else to review it.
>
> zw
>
>
>






[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors

2022-12-13 Thread Frederic Berat
On Mon, Dec 12, 2022 at 9:19 PM Zack Weinberg  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 
> >   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.

Actually, that is related. The edit removes the "#include subfoo.h"
line from foo.h, because the subfoo.h file got overwritten earlier.
This subfoo.h is the one that had the function declaration in ("extern
int subfoo (void);" specifically).
Either you need the original header back, or you need to get the
declaration back another way. I felt this way was easier than trying
to insert a declaration without breaking the test.

I agree that more explanation could have been useful. If you have
another suggestion to get the declaration in, I'm open.

>
> > --- 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.

Agree.

>
> > --- 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 
> > +
> > +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

2022-12-13 Thread Frederic Berat
On Mon, Dec 12, 2022 at 9:15 PM Zack Weinberg  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.
> > Not properly declaring main as "int main(...)" is rejected since c99.
> ...
> >   /* Valid C but deliberately invalid C++ */
> > -main ()
> > +int main (void)
>
> Note the comment.  Is this test program still invalid C++ after your change?

I assumed yes, since "new" should be a standard symbol, but I actually
forgot to double check.

>
> zw
>
>
>
>






[bug#59989] [PATCH] tests: Fix txinfo-include test for texinfo 7.x

2022-12-13 Thread Frederic Berat
Fine with me, thanks !

On Mon, Dec 12, 2022 at 11:52 PM Karl Berry  wrote:

> Hi Frederic,
>
> Texinfo modified its behavior regarding apostrophes, which are now
> replaced by UTF-8 right single quotes by default.
>
> Sorry to hear it, but not surprised.
>
> -GNU's Not Unix.
> +@verb{.GNU's Not Unix..}
>
> I don't think there's any guarantee that verb quotes will also be
> "helpfully" changed in the future. One wouldn't think so, but ...
>
> So instead, I changed the test document to avoid apostrophes. Pushed the
> below. Hope it flies. --thanks, karl.
>
> --- a/t/txinfo-include.sh
> +++ b/t/txinfo-include.sh
> @@ -28,6 +28,9 @@ main_TEXINFOS = one.texi two.texi three.texi
>  sub_more_TEXINFOS = sub/desc.texi sub/hist.texi
>  END
>
> +# We avoid apostrophes in the test document since Texinfo
> +# turns them into UTF-8, which is not easy to grep.
> +#
>  cat > main.texi << 'END'
>  \input texinfo
>  @setfilename main.info
> @@ -61,8 +64,8 @@ END
>
>  cat > three.texi << 'END'
>  @node three
> -@chapter Chapter two
> -GNU's Not Unix.
> +@chapter Chapter three
> +Quux quux quux.
>  END
>
>  mkdir sub
> @@ -106,7 +109,7 @@ check_info_contents ()
>srcdir=${1-.}
>$FGREP "Foo bar, baz."$srcdir/main.info
>$FGREP "Blah Blah Blah."  $srcdir/main.info
> -  $FGREP "GNU's Not Unix."  $srcdir/main.info
> +  $FGREP "Quux quux quux."  $srcdir/main.info
>$FGREP 'It does something, really.'   $srcdir/sub/more.info
>$FGREP 'It was written somehow.'  $srcdir/sub/more.info
>  }
>
> compile finished at Mon Dec 12 14:48:33 2022
>
>
>
>


[bug#59990] [PATCH] tests: depcomp: ensure make_ok() fails when run_make fails

2022-12-12 Thread Frederic Berat
From: Frédéric Bérat 

While running automake tests with -std-gnu=c99, the compiler report
errors which lead to make to fail. Yet, these failures are ignored
during the tests, which considers them to be successful as stderror is
check for one specific pattern.

If make fails, investigation should be made to discover why, whatever
the reason for the failure is.
---
 t/ax/depcomp.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh
index f23635086..e4e7565df 100644
--- a/t/ax/depcomp.sh
+++ b/t/ax/depcomp.sh
@@ -160,7 +160,7 @@ case $depcomp_with_libtool in
 echo lib_LTLIBRARIES = libfoo.la >> Makefile.am
 make_ok ()
 {
-  run_make -M -- ${1+"$@"}
+  run_make -M -- ${1+"$@"} || return 1
   $FGREP 'unknown directive' output && return 1
   rm -f output
   # Checks for stray files possibly left around by less common
-- 
2.38.1






[bug#59991] [PATCH 0/2] Port tests to modern C

2022-12-12 Thread Frederic Berat
Hello,

There is ongoing work from both GCC and Clang community to set the C99 standard
as the default one, in an effort to improve security overall.
In this context, Fedora packages were rebuilt with some warnings turned as
errors to simulate the change. This leads to failures in Automake, that are
attempted to be fixed, mainly in this patchset.

Another patch dedicated to Flex related tests will follow.

Fred.

---
Frédéric Bérat (2):
  tests: Fix 'type defaults' error in link_cond due to main not being
properly declared
  tests: Fix implicit function declaration errors

 t/ax/depcomp.sh  |  4 ++--
 t/c-demo.sh  |  1 +
 t/cond35.sh  |  2 ++
 t/dist-vs-built-sources.sh   |  1 +
 t/lex-clean.sh   |  1 +
 t/lex-multiple.sh|  4 
 t/lex-nodist.sh  |  2 ++
 t/link_cond.sh   |  2 +-
 t/ltcond2.sh |  2 ++
 t/ltconv.sh  |  6 ++
 t/subobj-clean-lt-pr10697.sh | 10 +-
 t/subobj-clean-pr10697.sh| 10 +-
 t/tags-pr12372.sh|  3 ++-
 t/yacc-basic.sh  |  1 +
 t/yacc-clean.sh  |  4 
 t/yacc-nodist.sh |  2 ++
 16 files changed, 49 insertions(+), 6 deletions(-)

-- 
2.38.1






[bug#59993] [PATCH 2/2] tests: Fix implicit function declaration errors

2022-12-12 Thread Frederic Berat
From: Frédéric Bérat 

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.
This is valid for both local functions and standard functions (as
printf).

Modified files:

 * t/ax/depcomp.sh
 * t/c-demo.sh
 * t/cond35.sh
 * t/dist-vs-built-sources.sh
 * t/lex-clean.sh
 * t/lex-multiple.sh
 * t/lex-nodist.sh
 * t/ltcond2.sh
 * t/ltconv.sh
 * t/subobj-clean-lt-pr10697.sh
 * t/subobj-clean-pr10697.sh
 * t/tags-pr12372.sh
 * t/yacc-basic.sh
 * t/yacc-clean.sh
 * t/yacc-nodist.sh
---
 t/ax/depcomp.sh  |  4 ++--
 t/c-demo.sh  |  1 +
 t/cond35.sh  |  2 ++
 t/dist-vs-built-sources.sh   |  1 +
 t/lex-clean.sh   |  1 +
 t/lex-multiple.sh|  4 
 t/lex-nodist.sh  |  2 ++
 t/ltcond2.sh |  2 ++
 t/ltconv.sh  |  6 ++
 t/subobj-clean-lt-pr10697.sh | 10 +-
 t/subobj-clean-pr10697.sh| 10 +-
 t/tags-pr12372.sh|  3 ++-
 t/yacc-basic.sh  |  1 +
 t/yacc-clean.sh  |  4 
 t/yacc-nodist.sh |  2 ++
 15 files changed, 48 insertions(+), 5 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 
 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"
diff --git a/t/c-demo.sh b/t/c-demo.sh
index 7e0e8d64f..d25bf214b 100644
--- a/t/c-demo.sh
+++ b/t/c-demo.sh
@@ -113,6 +113,7 @@ test -f build-aux/compile # We have per-target flags on C 
sources.
 ./configure --enable-dependency-tracking
 
 cat > src/main.c << 'END'
+#include 
 #include "foo.h"
 #include "bar.h"
 int main (void)
diff --git a/t/cond35.sh b/t/cond35.sh
index 215a22548..bad133970 100644
--- a/t/cond35.sh
+++ b/t/cond35.sh
@@ -73,6 +73,8 @@ END
 
 cat > tparse.y << 'END'
 %{
+extern int yylex(void);
+
 void yyerror (const char *s) {}
 %}
 %token EOF
diff --git a/t/dist-vs-built-sources.sh b/t/dist-vs-built-sources.sh
index d038e66dd..db2776f9a 100644
--- a/t/dist-vs-built-sources.sh
+++ b/t/dist-vs-built-sources.sh
@@ -41,6 +41,7 @@ foo_SOURCES = foo.c
 END
 
 cat > foo.c << 'END'
+#include 
 #include "h.h"
 int main (void) { printf ("%s\n", F); return 0; }
 END
diff --git a/t/lex-clean.sh b/t/lex-clean.sh
index 5aa199338..e53da8fd2 100644
--- a/t/lex-clean.sh
+++ b/t/lex-clean.sh
@@ -61,6 +61,7 @@ cat > lexer.l << 'END'
 END
 
 cat > main.c << 'END'
+extern int yylex (void);
 int main (void)
 {
   return yylex ();
diff --git a/t/lex-multiple.sh b/t/lex-multiple.sh
index 2655b633e..bf119ec84 100644
--- a/t/lex-multiple.sh
+++ b/t/lex-multiple.sh
@@ -56,6 +56,10 @@ cat > main.c << 'END'
 #include 
 #include 
 
+extern int yylex (void);
+extern int foolex (void);
+extern int bar_lex (void);
+
 int main (int argc, char *argv[])
 {
   if (argc != 2)
diff --git a/t/lex-nodist.sh b/t/lex-nodist.sh
index 599539405..187dd5437 100644
--- 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 ();
diff --git a/t/ltcond2.sh b/t/ltcond2.sh
index 29244c9b3..7e7bcadc4 100644
--- a/t/ltcond2.sh
+++ b/t/ltcond2.sh
@@ -73,6 +73,8 @@ void print (void)
 END
 
 cat > main.c <<'END'
+extern void print(void);
+
 int main (void)
 {
   print();
diff --git a/t/ltconv.sh b/t/ltconv.sh
index 2c4cc47a1..ec79ef80e 100644
--- 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 
+
+extern int sub1 (void);
+extern int sub2 (void);
+extern int sub21 (void);
+extern int sub22 (void);
+
 int main ()
 {
   if (1 != sub1 ())
diff --git a/t/subobj-clean-lt-pr10697.sh b/t/subobj-clean-lt-pr10697.sh
index bb656c43f..53fc02f09 100644
--- a/t/subobj-clean-lt-pr10697.sh
+++ b/t/subobj-clean-lt-pr10697.sh
@@ -83,7 +83,15 @@ libfoo_la_SOURCES = \
 END
 
 mkdir sub1 sub2
-echo 'int libmain (void)' > main.c
+
+echo "/* Subobj clean: libtool case*/" > main.c
+for i in 1 2; do
+  for j in a b c d e f; do
+echo "extern void $j$i (void);" >> main.c
+  done
+done
+
+echo 'int libmain (void)' >> main.c
 echo '{' >> main.c
 for i in 1 2; do
   for j in a b c d e f; do
diff --git a/t/subobj-clean-pr10697.sh b/t/subobj-clean-pr10697.sh
index f77de8c92..a7f97f6d1 100644
--- 

[bug#59992] [PATCH 1/2] tests: Fix 'type defaults' error in link_cond due to main not being properly declared

2022-12-12 Thread Frederic Berat
From: Frédéric Bérat 

This is related to an effort to prepare Automake for future GCC/Clang
versions which set c99 as default standard to be used.
Not properly declaring main as "int main(...)" is rejected since c99.
---
 t/link_cond.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/link_cond.sh b/t/link_cond.sh
index e7a13b614..533e359e2 100644
--- a/t/link_cond.sh
+++ b/t/link_cond.sh
@@ -52,7 +52,7 @@ $AUTOCONF
 rm -f *.c++
 cat > less.c <<'END'
 /* Valid C but deliberately invalid C++ */
-main ()
+int main (void)
 {
   int new = 0;
   return new;
-- 
2.38.1






[bug#59994] [PATCH] tests: Don't try to prevent flex to include unistd.h

2022-12-12 Thread Frederic Berat
From: Frédéric Bérat 

Hello,

This patch is mainly a proposal. While the macro can simply be removed
as explained below, another possibility it to add a flex option
"--never-interactive" to prevent flex to make use of "isatty".

-- 8< --

This is related to an effort to prepare Automake for future GCC/Clang
versions which set c99 as default standard to be used.

Future version of flex make the "NO_UNISTD" flag a no-op, and include
unistd.h by default.

In current version of flex, not having this header leads to implicit
function declarations that are not compatible with c99 standard.

On top of that, while flex dedicated test were having this macro set,
the yacc ones didn't have it despise their use of Flex. Thus, if this
macro was ever useful, it looks like nobody actually cared.

---
 t/cond35.sh   | 3 ---
 t/lex-clean.sh| 3 ---
 t/lex-depend.sh   | 3 ---
 t/lex-header.sh   | 3 ---
 t/lex-lib.sh  | 3 ---
 t/lex-libobj.sh   | 3 ---
 t/lex-line.sh | 3 ---
 t/lex-multiple.sh | 3 ---
 t/lex-nodist.sh   | 3 ---
 t/lex-noyywrap.sh | 3 ---
 t/lex3.sh | 3 ---
 t/lex5.sh | 3 ---
 t/lexvpath.sh | 9 -
 t/silent-lex.sh   | 3 ---
 14 files changed, 48 deletions(-)

diff --git a/t/cond35.sh b/t/cond35.sh
index bad133970..435e02ffc 100644
--- a/t/cond35.sh
+++ b/t/cond35.sh
@@ -58,9 +58,6 @@ $FGREP 'tparse.h' Makefile.in # For debugging.
 test $($FGREP -c 'tparse.h:' Makefile.in) -eq 1
 
 cat > tscan.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "END"   return EOF;
 %%
diff --git a/t/lex-clean.sh b/t/lex-clean.sh
index e53da8fd2..6ab451173 100644
--- a/t/lex-clean.sh
+++ b/t/lex-clean.sh
@@ -52,9 +52,6 @@ LDADD = $(LEXLIB)
 END
 
 cat > lexer.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "GOOD"   return EOF;
 .
diff --git a/t/lex-depend.sh b/t/lex-depend.sh
index c6fde8c1f..7fbf60370 100644
--- a/t/lex-depend.sh
+++ b/t/lex-depend.sh
@@ -42,9 +42,6 @@ test-obj-updated: joe.$(OBJEXT)
 END
 
 cat > joe.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "foo" return EOF;
 .
diff --git a/t/lex-header.sh b/t/lex-header.sh
index 73beb95b6..46e8be60c 100644
--- a/t/lex-header.sh
+++ b/t/lex-header.sh
@@ -45,9 +45,6 @@ END
 
 cat > lexer.l << 'END'
 %option noyywrap
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "GOOD"   return EOF;
 .
diff --git a/t/lex-lib.sh b/t/lex-lib.sh
index a251534d5..4ec75abe4 100644
--- a/t/lex-lib.sh
+++ b/t/lex-lib.sh
@@ -47,9 +47,6 @@ int yywrap (void)
 END
 
 cat > foo.l <<'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "END" return EOF;
 .
diff --git a/t/lex-libobj.sh b/t/lex-libobj.sh
index 5d4c13ebd..50ac10bb0 100644
--- a/t/lex-libobj.sh
+++ b/t/lex-libobj.sh
@@ -45,9 +45,6 @@ int yywrap (void)
 END
 
 cat > foo.l <<'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "END" return EOF;
 .
diff --git a/t/lex-line.sh b/t/lex-line.sh
index ef2a2a808..6107d0664 100644
--- a/t/lex-line.sh
+++ b/t/lex-line.sh
@@ -57,9 +57,6 @@ dir/quux.@OBJEXT@: dir/quux.c
 END
 
 cat > zardoz.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "END"  return EOF;
 .
diff --git a/t/lex-multiple.sh b/t/lex-multiple.sh
index bf119ec84..5f4695deb 100644
--- a/t/lex-multiple.sh
+++ b/t/lex-multiple.sh
@@ -76,9 +76,6 @@ int main (int argc, char *argv[])
 END
 
 cat > 0.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "VANILLA" { printf (":%s:\n", yytext); return 121; }
 . { printf (":%s:\n", yytext); return 1; }
diff --git a/t/lex-nodist.sh b/t/lex-nodist.sh
index 187dd5437..4a4d0f01c 100644
--- a/t/lex-nodist.sh
+++ b/t/lex-nodist.sh
@@ -45,9 +45,6 @@ check-local: test-build test-dist
 lexer.l:
rm -f $@ $@-t
:; { : \
- && echo '%{' \
- && echo '#define YY_NO_UNISTD_H 1' \
- && echo '%}' \
  && echo '%%' \
  && echo '"GOOD" return EOF;' \
  && echo '.'; \
diff --git a/t/lex-noyywrap.sh b/t/lex-noyywrap.sh
index c11813429..0451dbcf5 100644
--- a/t/lex-noyywrap.sh
+++ b/t/lex-noyywrap.sh
@@ -37,9 +37,6 @@ END
 
 cat > foo.l << 'END'
 %option noyywrap
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "GOOD"   return EOF;
 .
diff --git a/t/lex3.sh b/t/lex3.sh
index 7de5fe2a6..9e54e7abf 100644
--- a/t/lex3.sh
+++ b/t/lex3.sh
@@ -33,9 +33,6 @@ foo_SOURCES = foo.l
 END
 
 cat > foo.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "GOOD"   return EOF;
 .
diff --git a/t/lex5.sh b/t/lex5.sh
index 0563a35ee..da354e2ac 100644
--- a/t/lex5.sh
+++ b/t/lex5.sh
@@ -36,9 +36,6 @@ END
 mkdir foo
 
 cat > foo/foo.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "END"   return EOF;
 .
diff --git a/t/lexvpath.sh b/t/lexvpath.sh
index 84187a916..33fab0a80 100644
--- a/t/lexvpath.sh
+++ b/t/lexvpath.sh
@@ -44,9 +44,6 @@ END
 
 # Original lexer, with a "foobar" comment
 cat > lexer.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "END" return EOF;
 .
@@ -89,9 +86,6 @@ $sleep
 
 # New lexer, with 'fubar' comment.
 cat > ../lexer.l << 'END'
-%{
-#define YY_NO_UNISTD_H 1
-%}
 %%
 "END" return EOF;
 .
@@ -112,9 +106,6 @@ $sleep
 
 # New lexer, with 'maude' 

[bug#59989] [PATCH] tests: Fix txinfo-include test for texinfo 7.x

2022-12-12 Thread Frederic Berat
From: Frédéric Bérat 

Texinfo modified its behavior regarding apostrophes, which are now
replaced by UTF-8 right single quotes by default.
It looks like this was supposed to be the default for few years already,
but this behavior was broken so far.

Use the @verb construct in order to ensure that the quotes are kept
has-is, so that we can easily grep for "GNU's Not Unix".
---
 t/txinfo-include.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/txinfo-include.sh b/t/txinfo-include.sh
index 8a15f01b0..40b61878f 100644
--- a/t/txinfo-include.sh
+++ b/t/txinfo-include.sh
@@ -62,7 +62,7 @@ END
 cat > three.texi << 'END'
 @node three
 @chapter Chapter two
-GNU's Not Unix.
+@verb{.GNU's Not Unix..}
 END
 
 mkdir sub
-- 
2.38.1






Re: make check(s) pre-release problems

2022-10-11 Thread Frederic Berat
Hello,

I don't know if that will help, or if that is completely unrelated, but I'm
currently stumbling into a weird issue while working on a new package
release for autoconf on Fedora: about 200 tests are now failing, all
related to aclocal checks.
My current investigation shows that it would be related to a bash update
from 5.1.x to 5.2x which seems to have changed the behavior of the "SHLVL"
shell variable.

I actually wonder if your sudden "parallelism" failure could be somehow
linked to an update of bash, similar to mine ?

Fred.

On Fri, Oct 7, 2022 at 6:11 PM Zack Weinberg  wrote:

> On Thu, Oct 6, 2022, at 4:25 PM, Karl Berry wrote:
> > No errors on RHEL7+autoconf2.71
> >
> > Puzzling. Can you easily try RHEL8 or one of its derivatives?
> > It surprises me that that is the culprit, but it seems possible.
>
> Unfortunately, no.  CMU is mostly an Ubuntu shop these days.  It's only
> dumb luck that I happen to have access to a machine that hasn't had a major
> system upgrade since 2012 (and with my day-job hat on I'm actively trying
> to *get* it upgraded -- to Ubuntu.)
>
> zw
>
>