[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 <br...@clisp.org> strerror-override: Fix possible compilation error. Reported by Thomas Klausner <w...@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