bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / code / Atom feed
* Re: pkgsrc m4 patches
       [not found] <20210628183547.b4tcphi5urqsto3c@yt.nih.at>
@ 2021-06-29  0:21 ` Bruno Haible
  2021-06-29  1:36   ` john
  2021-06-29  5:26   ` Thomas Klausner
  0 siblings, 2 replies; 3+ messages in thread
From: Bruno Haible @ 2021-06-29  0:21 UTC (permalink / raw)
  To: Thomas Klausner; +Cc: bug-gnulib, js, jklos

[CCing bug-gnulib. We work in public; please avoid private email if
 there is a mailing list.]

Thomas Klausner wrote:
> Hi Bruno!
> 
> I just updated m4 in pkgsrc to 1.4.19 and noticed that I could remove
> almost all patches. Thank you for that!
> 
> Then I thought I'd point out the remaining ones to you in the hope we
> can get rid of those as well.
> 
> The first one is ancient, in pkgsrc since at least 2013; it's for the
> NetBSD vax port. I don't know more than that about it. jklos committed
> it, so perhaps he has more details.
> 
> The other one is more recent and was committed as a "fix for QNX".  js
> committed it and might know more.

> [2 patches from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/m4/patches/]

Thanks Thomas for the pointer.

Regarding NetBSD/vax support, I won't act because
  1) the patch does not give background information,
  2) I guess that this platform is in the same category as
     https://www.gnu.org/software/gnulib/manual/html_node/Unsupported-Platforms.html
     and all CPUs that were designed later than DEC alpha support
     IEEE 854 well, including NaNs.

Regarding the strerror-override module: There is indeed the possibility
that strerror-override.c gets compiled even though strerror_override is
defined as a macro.

Fixing it like this. A separate macro is used so that config.h files can do
  #define strerror_override libfoo_strerror_override
(when cleaning up the namespace of symbols exported by a library libfoo).


2021-06-28  Bruno Haible  <bruno@clisp.org>

	strerror-override: Fix possible compilation error.
	Reported by Thomas Klausner <wiz@netbsd.org>.
	* lib/strerror-override.h (GNULIB_defined_strerror_override_macro): New
	macro.
	* lib/strerror-override.c (strerror_override): Don't define if
	GNULIB_defined_strerror_override_macro is set.

diff --git a/lib/strerror-override.h b/lib/strerror-override.h
index 03e98e3..9cfc5ad 100644
--- a/lib/strerror-override.h
+++ b/lib/strerror-override.h
@@ -51,6 +51,7 @@
 extern const char *strerror_override (int errnum) _GL_ATTRIBUTE_CONST;
 # else
 #  define strerror_override(ignored) NULL
+#  define GNULIB_defined_strerror_override_macro 1
 # endif
 
 #endif /* _GL_STRERROR_OVERRIDE_H */
diff --git a/lib/strerror-override.c b/lib/strerror-override.c
index 172a1d3..e76d55d 100644
--- a/lib/strerror-override.c
+++ b/lib/strerror-override.c
@@ -29,6 +29,8 @@
 # endif
 #endif
 
+#if !GNULIB_defined_strerror_override_macro
+
 /* If ERRNUM maps to an errno value defined by gnulib, return a string
    describing the error.  Otherwise return NULL.  */
 const char *
@@ -37,12 +39,12 @@ strerror_override (int errnum)
   /* These error messages are taken from glibc/sysdeps/gnu/errlist.c.  */
   switch (errnum)
     {
-#if REPLACE_STRERROR_0
+# if REPLACE_STRERROR_0
     case 0:
       return "Success";
-#endif
+# endif
 
-#if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */
+# if GNULIB_defined_ESOCK /* native Windows platforms with older <errno.h> */
     case EINPROGRESS:
       return "Operation now in progress";
     case EALREADY:
@@ -89,8 +91,8 @@ strerror_override (int errnum)
       return "No route to host";
     case EWOULDBLOCK:
       return "Operation would block";
-#endif
-#if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */
+# endif
+# if GNULIB_defined_ESTREAMS /* native Windows platforms with older <errno.h> */
     case ETXTBSY:
       return "Text file busy";
     case ENODATA:
@@ -103,8 +105,8 @@ strerror_override (int errnum)
       return "Timer expired";
     case EOTHER:
       return "Other error";
-#endif
-#if GNULIB_defined_EWINSOCK /* native Windows platforms */
+# endif
+# if GNULIB_defined_EWINSOCK /* native Windows platforms */
     case ESOCKTNOSUPPORT:
       return "Socket type not supported";
     case EPFNOSUPPORT:
@@ -125,7 +127,7 @@ strerror_override (int errnum)
       return "Stale NFS file handle";
     case EREMOTE:
       return "Object is remote";
-# if HAVE_WINSOCK2_H
+#  if HAVE_WINSOCK2_H
       /* WSA_INVALID_HANDLE maps to EBADF */
       /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
       /* WSA_INVALID_PARAMETER maps to EINVAL */
@@ -213,90 +215,92 @@ strerror_override (int errnum)
     case WSANO_DATA:
       return "Valid name, no data record of requested type";
       /* WSA_QOS_* omitted */
+#  endif
 # endif
-#endif
 
-#if GNULIB_defined_ENOMSG
+# if GNULIB_defined_ENOMSG
     case ENOMSG:
       return "No message of desired type";
-#endif
+# endif
 
-#if GNULIB_defined_EIDRM
+# if GNULIB_defined_EIDRM
     case EIDRM:
       return "Identifier removed";
-#endif
+# endif
 
-#if GNULIB_defined_ENOLINK
+# if GNULIB_defined_ENOLINK
     case ENOLINK:
       return "Link has been severed";
-#endif
+# endif
 
-#if GNULIB_defined_EPROTO
+# if GNULIB_defined_EPROTO
     case EPROTO:
       return "Protocol error";
-#endif
+# endif
 
-#if GNULIB_defined_EMULTIHOP
+# if GNULIB_defined_EMULTIHOP
     case EMULTIHOP:
       return "Multihop attempted";
-#endif
+# endif
 
-#if GNULIB_defined_EBADMSG
+# if GNULIB_defined_EBADMSG
     case EBADMSG:
       return "Bad message";
-#endif
+# endif
 
-#if GNULIB_defined_EOVERFLOW
+# if GNULIB_defined_EOVERFLOW
     case EOVERFLOW:
       return "Value too large for defined data type";
-#endif
+# endif
 
-#if GNULIB_defined_ENOTSUP
+# if GNULIB_defined_ENOTSUP
     case ENOTSUP:
       return "Not supported";
-#endif
+# endif
 
-#if GNULIB_defined_ENETRESET
+# if GNULIB_defined_ENETRESET
     case ENETRESET:
       return "Network dropped connection on reset";
-#endif
+# endif
 
-#if GNULIB_defined_ECONNABORTED
+# if GNULIB_defined_ECONNABORTED
     case ECONNABORTED:
       return "Software caused connection abort";
-#endif
+# endif
 
-#if GNULIB_defined_ESTALE
+# if GNULIB_defined_ESTALE
     case ESTALE:
       return "Stale NFS file handle";
-#endif
+# endif
 
-#if GNULIB_defined_EDQUOT
+# if GNULIB_defined_EDQUOT
     case EDQUOT:
       return "Disk quota exceeded";
-#endif
+# endif
 
-#if GNULIB_defined_ECANCELED
+# if GNULIB_defined_ECANCELED
     case ECANCELED:
       return "Operation canceled";
-#endif
+# endif
 
-#if GNULIB_defined_EOWNERDEAD
+# if GNULIB_defined_EOWNERDEAD
     case EOWNERDEAD:
       return "Owner died";
-#endif
+# endif
 
-#if GNULIB_defined_ENOTRECOVERABLE
+# if GNULIB_defined_ENOTRECOVERABLE
     case ENOTRECOVERABLE:
       return "State not recoverable";
-#endif
+# endif
 
-#if GNULIB_defined_EILSEQ
+# if GNULIB_defined_EILSEQ
     case EILSEQ:
       return "Invalid or incomplete multibyte or wide character";
-#endif
+# endif
 
     default:
       return NULL;
     }
 }
+
+#endif



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pkgsrc m4 patches
  2021-06-29  0:21 ` pkgsrc m4 patches Bruno Haible
@ 2021-06-29  1:36   ` john
  2021-06-29  5:26   ` Thomas Klausner
  1 sibling, 0 replies; 3+ messages in thread
From: john @ 2021-06-29  1:36 UTC (permalink / raw)
  To: Bruno Haible; +Cc: Thomas Klausner, js, bug-gnulib

>> I just updated m4 in pkgsrc to 1.4.19 and noticed that I could remove
>> almost all patches. Thank you for that!
>>
>> Then I thought I'd point out the remaining ones to you in the hope we
>> can get rid of those as well.
>>
>> The first one is ancient, in pkgsrc since at least 2013; it's for the
>> NetBSD vax port. I don't know more than that about it. jklos committed
>> it, so perhaps he has more details.

> Regarding NetBSD/vax support, I won't act because
>  1) the patch does not give background information,
>  2) I guess that this platform is in the same category as
>     https://www.gnu.org/software/gnulib/manual/html_node/Unsupported-Platforms.html
>     and all CPUs that were designed later than DEC alpha support
>     IEEE 854 well, including NaNs.

VAX is certainly not in the same category as the examples on that page :P

That said, the patch isn't needed any more, since evaluation at compile 
time doesn't happen any more.

Thanks,
John Klos



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: pkgsrc m4 patches
  2021-06-29  0:21 ` pkgsrc m4 patches Bruno Haible
  2021-06-29  1:36   ` john
@ 2021-06-29  5:26   ` Thomas Klausner
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Klausner @ 2021-06-29  5:26 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib, js, jklos

On Tue, Jun 29, 2021 at 02:21:47AM +0200, Bruno Haible wrote:
> [CCing bug-gnulib. We work in public; please avoid private email if
>  there is a mailing list.]

Sorry, I'll keep that in mind.

> Thomas Klausner wrote:
> > Hi Bruno!
> > 
> > I just updated m4 in pkgsrc to 1.4.19 and noticed that I could remove
> > almost all patches. Thank you for that!
> > 
> > Then I thought I'd point out the remaining ones to you in the hope we
> > can get rid of those as well.
> > 
> > The first one is ancient, in pkgsrc since at least 2013; it's for the
> > NetBSD vax port. I don't know more than that about it. jklos committed
> > it, so perhaps he has more details.
> > 
> > The other one is more recent and was committed as a "fix for QNX".  js
> > committed it and might know more.
> 
> > [2 patches from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/m4/patches/]
> 
> Thanks Thomas for the pointer.
> 
> Regarding NetBSD/vax support, I won't act because
>   1) the patch does not give background information,
>   2) I guess that this platform is in the same category as
>      https://www.gnu.org/software/gnulib/manual/html_node/Unsupported-Platforms.html
>      and all CPUs that were designed later than DEC alpha support
>      IEEE 854 well, including NaNs.

After jklos' message, I've removed this patch from pkgsrc.

> Regarding the strerror-override module: There is indeed the possibility
> that strerror-override.c gets compiled even though strerror_override is
> defined as a macro.
> 
> Fixing it like this. A separate macro is used so that config.h files can do
>   #define strerror_override libfoo_strerror_override
> (when cleaning up the namespace of symbols exported by a library libfoo).

Thanks!
 Thomas


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-29  5:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210628183547.b4tcphi5urqsto3c@yt.nih.at>
2021-06-29  0:21 ` pkgsrc m4 patches Bruno Haible
2021-06-29  1:36   ` john
2021-06-29  5:26   ` Thomas Klausner

Code repositories for project(s) associated with this inbox:

	../../../mirrors/gnulib.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).