Re: recommending AC_SYS_YEAR2038_REQUIRED ?

2023-04-11 Thread Sam James

Bruno Haible  writes:

> Paul Eggert wrote:
>> > How about a middle ground between the two macros? A macro, say
>> > AC_SYS_YEAR2038_UNLESS_OPT_OUT (*), that
>> >- like AC_SYS_YEAR2038, has the option --disable-year2038,
>> >- like AC_SYS_YEAR2038_REQUIRED, fails if a large 'time_t' is
>> >  unavailable and --disable-year2038 was not specified.
>> 
>> Even simpler, let's have just one new macro instead of two. I.e., let's 
>> change Autoconf to remove AC_SYS_YEAR2038_REQUIRED and to define instead 
>> a macro AC_SYS_YEAR2038_OPT_OUT that acts like AC_SYS_YEAR2038 except it 
>> errors out if wide time_t and --disable-year2038 are both missing.
>> 
>> Then let's propagate this change into Gnulib, and rename Gnulib's 
>> year2030-required module to year2038-opt-out.
>
> I like this. Thanks.

Thanks for bringing this up Bruno. This is a reasonable compromise to me
- not just in the change here, but in the documentation/phrasing tweak
as I was concerned about the rather forthright recommendation & presentation of
year2038-required.

>
> And if the package would very much like to assume a wide time_t and
> therefore has some test suite failures if --disable-year2038 was specified,
> so be it. It's better to be able to build a package at all, with some
> test suite failures, than not being able to build it at all.
>

I feel on the fence about this bit: I think it's reasonable to provide
a macro to require it as a last resort for people, but on the other
hand, providing it might be seen to encourage it as a reasonable
solution, when in most cases, it's not that way at all,
so I'll go with however the majority feels on that.

>> Similarly for AC_SYS_LARGEFILE_REQUIRED.

... and this.

>
> For the sake of symmetry between the two, that makes sense.
>

Thanks Paul as well.

best,
sam


signature.asc
Description: PGP signature


Re: recommending AC_SYS_YEAR2038_REQUIRED ?

2023-04-11 Thread Zack Weinberg
On Mon, Apr 10, 2023, at 7:00 PM, Paul Eggert wrote:
> On 2023-04-10 15:36, Bruno Haible wrote:
>> I like this. Thanks.
>
> OK, then let's hear Zack's opinion and hopefully move forward.

I'm also happy with this resolution.  I do not have time to do the Autoconf 
work until the weekend.

zw



Re: doc: Clarify list of platforms for year2038 support

2023-04-11 Thread Paul Eggert

On 4/11/23 06:45, Adhemerval Zanella Netto wrote:


It makes difference on all ABIs with has originally 32 bit time_t support:
i686, microblaze, arm, m68k, sh, csky, nios2, and hppa, powerpc32, sparc32,
s390, and mips o32.


Thanks, I installed the attached. It also mentions Android, which still 
supports a 32-bit ABI though rumors are it's going away in Android 14; 
see .


As I'm not sure about the difference between your "mips o32" and the 
doc's "mips (32-bit or n32 ABI)", I left the doc alone there.From eebb3a74aecc84cc2a316015ca58dc8ba3f35875 Mon Sep 17 00:00:00 2001
From: Paul Eggert 
Date: Tue, 11 Apr 2023 14:54:20 -0700
Subject: [PATCH] doc: update year2038 list further
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Prompted by Adhemerval Zanella Netto’s email in:
https://lists.gnu.org/r/bug-gnulib/2023-04/msg00083.html
Also, mention 32-bit Android.
* doc/year2038.texi: Mention Linux/ork1 and Android.
Append "32" to powerpc and sparc names.
---
 ChangeLog | 9 +
 doc/year2038.texi | 6 --
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a37429f7f6..c80d5587e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-04-11  Paul Eggert  
+
+	doc: update year2038 list further
+	Prompted by Adhemerval Zanella Netto’s email in:
+	https://lists.gnu.org/r/bug-gnulib/2023-04/msg00083.html
+	Also, mention 32-bit Android.
+	* doc/year2038.texi: Mention Linux/ork1 and Android.
+	Append "32" to powerpc and sparc names.
+
 2023-04-11  Bruno Haible  
 
 	Fix the "make sc_prohibit_AC_LIBOBJ_in_m4" findings.
diff --git a/doc/year2038.texi b/doc/year2038.texi
index 626729578f..4dac00bf56 100644
--- a/doc/year2038.texi
+++ b/doc/year2038.texi
@@ -58,11 +58,11 @@ in bi-arch systems):
 @itemize
 @item
 Linux kernel 5.1 (2019) and later with glibc 2.34 (2021) and later on
-x86, arm, mips (32-bit or n32 ABI), powerpc, sparc, s390, hppa, m68k, sh, csky, microblaze, nios2,
+x86, arm, mips (32-bit or n32 ABI), powerpc32, sparc32, s390, hppa, m68k, sh, csky, microblaze, nios2,
 @item
 Linux kernel 5.1 (2019) and later with musl libc 1.2 (2020) and later on x86,
 @item
-Linux on arc, loong32, riscv32 and x86_64-x32,
+Linux on arc, loong32, ork1, riscv32 and x86_64-x32,
 @item
 NetBSD 6.0 (2012) and later on x86 and sparc,
 @item
@@ -81,6 +81,8 @@ platforms or ABIs:
 
 @itemize
 @item
+Android,
+@item
 Mac OS X 10.6 (2009) and earlier on x86 and powerpc,
 @item
 GNU/Hurd/x86,
-- 
2.39.2



some syntax-check fixes

2023-04-11 Thread Bruno Haible
I tried some sc_* rules from the main Makefile.

Patch 0001 fixes an alert by 'kate' for Makefile command lines that don't start
with a tab.

Patch 0002 fixes some of the "make sc_prohibit_leading_TABs" output.
The affected files are not shared with glibc, therefore the change
won't cause trouble in glibc merges.

Patch 0003 fixes the "make sc_prohibit_AC_LIBOBJ_in_m4" findings.


2023-04-11  Bruno Haible  

Fix the "make sc_prohibit_AC_LIBOBJ_in_m4" findings.
* Makefile (allow_AC_LIBOBJ): Update after 2023-03-24 change. Add
termcap, terminfo.

2023-04-11  Bruno Haible  

Fix some "make sc_prohibit_leading_TABs" findings.
* tests/test-calloc-gnu.c: Expand tabs.
* tests/test-regex.c: Likewise.

2023-04-11  Bruno Haible  

Makefile: Fix a syntax alert.
* Makefile: Indent commands with tabs, not spaces.

>From d9b89953dbc6f35b20f71dbc1f8586bb824bb602 Mon Sep 17 00:00:00 2001
From: Bruno Haible 
Date: Tue, 11 Apr 2023 19:34:50 +0200
Subject: [PATCH 1/3] Makefile: Fix a syntax alert.

* Makefile: Indent commands with tabs, not spaces.
---
 ChangeLog | 5 +
 Makefile  | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c9962a09b9..8ffdb339d0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-04-11  Bruno Haible  
+
+	Makefile: Fix a syntax alert.
+	* Makefile: Indent commands with tabs, not spaces.
+
 2023-04-10  Bruno Haible  
 
 	alignasof: Ensure a correct _Alignas (regression 2023-01-15).
diff --git a/Makefile b/Makefile
index 4429571218..26432cd78a 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ sc_prohibit_sc_omitted_at:
 sc_maint:
 	@rm -f maint.mk; ln -s top/maint.mk maint.mk
 	$(MAKE) -s srcdir=. gnulib_dir=. _build-aux=build-aux \
--f cfg.mk -f maint.mk syntax-check
+	-f cfg.mk -f maint.mk syntax-check
 	rm -f maint.mk
 
 # Files in m4/ that (exceptionally) may use AC_LIBOBJ.
@@ -199,5 +199,5 @@ update-copyright:
 	  doc/gendocs_template* build-aux/gendocs.sh
 	export TZ='$(COPYRIGHT_TZ)';	\
 	perl -pi -e			\
-  '$(_year_and_prev) s/^(scriptversion=)$$w.*/$$1$$y-01-01.00/i' \
+	  '$(_year_and_prev) s/^(scriptversion=)$$w.*/$$1$$y-01-01.00/i' \
 	  build-aux/gendocs.sh
-- 
2.34.1

>From cc58717033a1f7755429031cd6dd4818f5c2d160 Mon Sep 17 00:00:00 2001
From: Bruno Haible 
Date: Tue, 11 Apr 2023 19:37:24 +0200
Subject: [PATCH 2/3] Fix some "make sc_prohibit_leading_TABs" findings.

* tests/test-calloc-gnu.c: Expand tabs.
* tests/test-regex.c: Likewise.
---
 ChangeLog   |  6 ++
 tests/test-calloc-gnu.c |  2 +-
 tests/test-regex.c  | 36 ++--
 3 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8ffdb339d0..b7dda4241b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-04-11  Bruno Haible  
+
+	Fix some "make sc_prohibit_leading_TABs" findings.
+	* tests/test-calloc-gnu.c: Expand tabs.
+	* tests/test-regex.c: Likewise.
+
 2023-04-11  Bruno Haible  
 
 	Makefile: Fix a syntax alert.
diff --git a/tests/test-calloc-gnu.c b/tests/test-calloc-gnu.c
index bcd47d4f01..fd72c44c60 100644
--- a/tests/test-calloc-gnu.c
+++ b/tests/test-calloc-gnu.c
@@ -63,7 +63,7 @@ main ()
 ASSERT (p == NULL);
 ASSERT (errno == ENOMEM);
 
-	p = calloc (SIZE_MAX / n + 1, identity (n));
+p = calloc (SIZE_MAX / n + 1, identity (n));
 ASSERT (p == NULL);
 ASSERT (errno == ENOMEM);
   }
diff --git a/tests/test-regex.c b/tests/test-regex.c
index aa85e81c56..787ca51472 100644
--- a/tests/test-regex.c
+++ b/tests/test-regex.c
@@ -134,31 +134,31 @@ bug_regex11 (void)
 {
   n = regcomp (, tests[i].pattern, tests[i].flags);
   if (n != 0)
-	{
-	  char buf[500];
-	  regerror (n, , buf, sizeof (buf));
-	  report_error ("%s: regcomp %zd failed: %s", tests[i].pattern, i, buf);
-	  continue;
-	}
+{
+  char buf[500];
+  regerror (n, , buf, sizeof (buf));
+  report_error ("%s: regcomp %zd failed: %s", tests[i].pattern, i, buf);
+  continue;
+}
 
   if (regexec (, tests[i].string, tests[i].nmatch, rm, 0))
-	{
-	  report_error ("%s: regexec %zd failed", tests[i].pattern, i);
-	  regfree ();
-	  continue;
-	}
+{
+  report_error ("%s: regexec %zd failed", tests[i].pattern, i);
+  regfree ();
+  continue;
+}
 
   for (n = 0; n < tests[i].nmatch; ++n)
-	if (rm[n].rm_so != tests[i].rm[n].rm_so
+if (rm[n].rm_so != tests[i].rm[n].rm_so
   || rm[n].rm_eo != tests[i].rm[n].rm_eo)
-	  {
-	if (tests[i].rm[n].rm_so == -1 && tests[i].rm[n].rm_eo == -1)
-	  break;
-	report_error ("%s: regexec %zd match failure rm[%d] %d..%d",
+  {
+if (tests[i].rm[n].rm_so == -1 && tests[i].rm[n].rm_eo == -1)
+  break;
+report_error ("%s: regexec %zd match failure rm[%d] %d..%d",

Re: doc: Clarify list of platforms for year2038 support

2023-04-11 Thread Adhemerval Zanella Netto



On 11/04/23 02:33, Paul Eggert wrote:
> Oh, I forgot to send comments that partly explain my recent changes in this 
> area. Here they are, belatedly:
> 
> 
> On 2023-04-10 05:56, Bruno Haible wrote:
> 
>> +@item
>> +Linux/riscv32,
> 
>  says this platform used 64-bit time_t "from 
> the get go".

Yes, all newer 32 bits architectures added after y2038 work on glibc uses 64 
bit time_t 
as default (riscv32, ork1, arc).

> 
>> +Linux with musl libc on x86,
> 
>  says that musl uses 64-bit time_t on 
> all architectures starting with 1.2.0.
> 
>> +@item
>> +Cygwin/x86,
> 
> Cygwin dropped 32-bit support last year (3.3.6 is the last version with x86), 
> so this could use a date. Come to think of it, other entries could use dates 
> too.
> 
>> +Whereas no failure will occur on the following 32-bit platforms or ABIs:
>> +@itemize
>> +@item
>> +Linux/x86 with glibc >= 2.34 on
>> +x86, arm, mips (32-bit or n32 ABI), powerpc, sparc, s390, hppa, m68k, sh, 
>> csky, microblaze, nios2,
> 
> I vaguely recall someone telling me that _TIME_BITS=64 makes a difference 
> only on x86 and arm. But perhaps that was just for one distro that doesn't do 
> those other ports.

It makes difference on all ABIs with has originally 32 bit time_t support:
i686, microblaze, arm, m68k, sh, csky, nios2, and hppa, powerpc32, sparc32,
s390, and mips o32.