[tin 2.4.0] snapshots - please test
I've made snapshots of the upcomming 2.4.0 release (planned for August 23rd), please give them a try and report (or even fix) any issues: <ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.xz> <ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.bz2> <ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.gz> urs
Hi Urs, On Aug 9 13:35, Urs Janßen wrote:
I've made snapshots of the upcomming 2.4.0 release (planned for August 23rd), please give them a try and report (or even fix) any issues:
<ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.xz> <ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.bz2> <ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.gz>
I encountered two build problems in the tin configury. I was trying to build the snapshot on Cygwin and noticed lots of warnings in terms of the strcasecmp function being undeclared. To explain why I only noticed now, lately newlib and Cygwin had a major revamp of the header files to align the feature macro handling closer to the standards and ultimately to glibc as far as GNU extensions are concerned. When building on Cygwin, the tin configury sets -D_XOPEN_SOURCE=600. However, tin.h contains this: #ifndef __QNX__ # ifdef HAVE_STRING_H # include <string.h> # else # ifdef HAVE_STRINGS_H # include <strings.h> # endif /* HAVE_STRINGS_H */ # endif /* HAVE_STRING_H */ #else # ifdef HAVE_STRING_H # include <string.h> # endif /* HAVE_STRING_H */ # ifdef HAVE_STRINGS_H # include <strings.h> # endif /* HAVE_STRINGS_H */ #endif /* !__QNX__ */ So on non-__QNX__ systems, prefer to include string.h and only if that's not available, include strings.h. AFAICS this is incorrect. POSIX-1.2008 requires to include strings.h to get strcasecmp/strncasecmp. Per the glibc man page the declarations are in string.h only on BSD systems or in BSD compatiblity mode. You won't notice this on Linux, because on Linux the aclocal.m4 function CF_XOPEN_SOURCE will set the compatibility mode to -D_GNU_SOURCE, rather than -D_XOPEN_SOURCE=600. I think the right thing to do is to change tin.h to always include string.h and strings.h when they are available, i. e.: ==================================================================== --- include/tin.h.ORIG 2016-08-09 15:39:15.828993933 +0200 +++ include/tin.h 2016-08-09 15:39:28.731060140 +0200 @@ -242,22 +242,12 @@ enum rc_state { RC_IGNORE, RC_CHECK, RC_ /* * FIXME: make this autoconf */ -#ifndef __QNX__ -# ifdef HAVE_STRING_H -# include <string.h> -# else -# ifdef HAVE_STRINGS_H -# include <strings.h> -# endif /* HAVE_STRINGS_H */ -# endif /* HAVE_STRING_H */ -#else -# ifdef HAVE_STRING_H -# include <string.h> -# endif /* HAVE_STRING_H */ -# ifdef HAVE_STRINGS_H -# include <strings.h> -# endif /* HAVE_STRINGS_H */ -#endif /* !__QNX__ */ +#ifdef HAVE_STRING_H +# include <string.h> +#endif /* HAVE_STRING_H */ +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif /* HAVE_STRINGS_H */ /* * FIXME: make this autoconf ==================================================================== The second problem I encountered is a missing declaration of vasprintf. The reason here is that configure checks for the existence of vasprintf, but then the tin headers don't define _GNU_SOURCE before using vasprintf, even though vasprintf is a GNU extension. I think the right thing to do here is to define _GNU_SOURCE as soon as HAVE_VASPRINTF is defined. E. g: ==================================================================== --- include/tin.h.ORIG 2016-08-09 15:39:15.828993933 +0200 +++ include/tin.h 2016-08-09 15:52:22.208046323 +0200 @@ -104,6 +104,9 @@ enum icontext { cNone, cGetline, cPrompt enum resizer { cNo, cYes, cRedraw }; enum rc_state { RC_IGNORE, RC_CHECK, RC_UPGRADE, RC_DOWNGRADE, RC_ERROR }; +#ifdef HAVE_VASPRINTF +# define _GNU_SOURCE +#endif #include <stdio.h> #ifdef HAVE_ERRNO_H # include <errno.h> ==================================================================== A Cygwin-specific workaround for both problems would be to change CF_XOPEN_SOURCE to use the same mechanism to set _GNU_SOURCE as on Linux etc, and to regenerate configure: ==================================================================== --- aclocal.m4.ORIG 2016-08-09 15:35:17.983772427 +0200 +++ aclocal.m4 2016-08-09 16:06:06.794538386 +0200 @@ -5599,7 +5599,7 @@ case $host_os in (aix[[4-7]]*) cf_xopen_source="-D_ALL_SOURCE" ;; -(cygwin|msys) +(msys) cf_XOPEN_SOURCE=600 ;; (darwin[[0-8]].*) @@ -5627,7 +5627,7 @@ case $host_os in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|gnu*|mint*|k*bsd*-gnu) +(linux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE ;; (minix*) ==================================================================== Thanks, Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
On Tue, Aug 09, 2016 at 04:10:07PM +0200, Corinna Vinschen wrote:
Hi Urs,
On Aug 9 13:35, Urs Janßen wrote:
I've made snapshots of the upcomming 2.4.0 release (planned for August 23rd), please give them a try and report (or even fix) any issues:
<ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.xz> <ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.bz2> <ftp://ftp.tin.org/pub/news/clients/tin/v2.3/snapshots/tin-2.4.0.tar.gz>
I encountered two build problems in the tin configury.
I was trying to build the snapshot on Cygwin and noticed lots of warnings in terms of the strcasecmp function being undeclared.
okay...
To explain why I only noticed now, lately newlib and Cygwin had a major revamp of the header files to align the feature macro handling closer to the standards and ultimately to glibc as far as GNU extensions are concerned.
as a rule, I don't use changes that only work on "new" systems.
When building on Cygwin, the tin configury sets -D_XOPEN_SOURCE=600. However, tin.h contains this:
#ifndef __QNX__ # ifdef HAVE_STRING_H # include <string.h> # else # ifdef HAVE_STRINGS_H # include <strings.h> # endif /* HAVE_STRINGS_H */ # endif /* HAVE_STRING_H */ #else # ifdef HAVE_STRING_H # include <string.h> # endif /* HAVE_STRING_H */ # ifdef HAVE_STRINGS_H # include <strings.h> # endif /* HAVE_STRINGS_H */ #endif /* !__QNX__ */
So on non-__QNX__ systems, prefer to include string.h and only if that's not available, include strings.h.
AFAICS this is incorrect. POSIX-1.2008 requires to include strings.h to get strcasecmp/strncasecmp.
It might be now, but when I added it, there were (possibly still are...) systems which would have conflicting definitions.
Per the glibc man page the declarations are in string.h only on BSD systems or in BSD compatiblity mode. You won't notice this on Linux,
My Debian 7 manual page only shows strings.h The header files have the prototypes in both (but not ifdef'd to match your description).
because on Linux the aclocal.m4 function CF_XOPEN_SOURCE will set the compatibility mode to -D_GNU_SOURCE, rather than -D_XOPEN_SOURCE=600.
that's what works for Linux.
I think the right thing to do is to change tin.h to always include string.h and strings.h when they are available, i. e.:
It's worth a try, to see what breaks :-)
The second problem I encountered is a missing declaration of vasprintf. The reason here is that configure checks for the existence of vasprintf, but then the tin headers don't define _GNU_SOURCE before using vasprintf, even though vasprintf is a GNU extension.
_GNU_SOURCE should be defined in the makefile (not in the headers). Defining that sort of thing in the header files has never worked reliably.
I think the right thing to do here is to define _GNU_SOURCE as soon as HAVE_VASPRINTF is defined. E. g:
nope. If it's not defined by CF_XOPEN_SOURCE and/or CF_GNU_SOURCE, it's probably incorrect.
A Cygwin-specific workaround for both problems would be to change CF_XOPEN_SOURCE to use the same mechanism to set _GNU_SOURCE as on Linux etc, and to regenerate configure:
==================================================================== --- aclocal.m4.ORIG 2016-08-09 15:35:17.983772427 +0200 +++ aclocal.m4 2016-08-09 16:06:06.794538386 +0200 @@ -5599,7 +5599,7 @@ case $host_os in (aix[[4-7]]*) cf_xopen_source="-D_ALL_SOURCE" ;; -(cygwin|msys) +(msys) cf_XOPEN_SOURCE=600 ;; (darwin[[0-8]].*) @@ -5627,7 +5627,7 @@ case $host_os in cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; -(linux*|gnu*|mint*|k*bsd*-gnu) +(linux*|gnu*|mint*|k*bsd*-gnu|cygwin) CF_GNU_SOURCE
again - something to try :-) -- Thomas E. Dickey <dickey@invisible-island.net> http://invisible-island.net ftp://invisible-island.net
On Tue, Aug 09, 2016 at 09:06:17PM -0400, Thomas Dickey wrote:
On Tue, Aug 09, 2016 at 04:10:07PM +0200, Corinna Vinschen wrote:
First of all, thanks to Corinna for reporting and giving such detailed descriptions and fixes and Thomas for commenting on them.
A Cygwin-specific workaround for both problems would be to change CF_XOPEN_SOURCE to use the same mechanism to set _GNU_SOURCE as on Linux etc, and to regenerate configure:
Even if that seems not to be the perfect way - as that might only break older cygwin installations (I just have cygwin 2.5.2 to test with) but no other systems, that's what I'll do for tin 2.4.0. I've updated the snapshots on the ftp-server. urs -- "Only whimps use tape backup: _real_ men just upload their important stuff on ftp, and let the rest of the world mirror it ;)" - Linus
On Aug 10 09:28, Urs Janßen wrote:
On Tue, Aug 09, 2016 at 09:06:17PM -0400, Thomas Dickey wrote:
On Tue, Aug 09, 2016 at 04:10:07PM +0200, Corinna Vinschen wrote:
First of all, thanks to Corinna for reporting and giving such detailed descriptions and fixes and Thomas for commenting on them.
A Cygwin-specific workaround for both problems would be to change CF_XOPEN_SOURCE to use the same mechanism to set _GNU_SOURCE as on Linux etc, and to regenerate configure:
Even if that seems not to be the perfect way - as that might only break older cygwin installations (I just have cygwin 2.5.2 to test with) but no other systems, that's what I'll do for tin 2.4.0. I've updated the snapshots on the ftp-server.
Thank you. The newlib/Cygwin header file changes have been introduced earlier this year. As far as Cygwin is concerned, the new feature test macros are used since Cygwin 2.5.0. In terms of older Cygwin releases, I tested with the pre-change Red Hat release 2.0.4rh-2 and it still builds tin-2.4.0 with this change, albeit with warnings: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../include -I../pcre [...] \ -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE=600 [...] -c [...]/src/tmpfile.c <command-line>:0:0: warning: "_XOPEN_SOURCE" redefined <command-line>:0:0: note: this is the location of the previous definition Thanks again, Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
On Aug 10 11:04, Corinna Vinschen wrote:
On Aug 10 09:28, Urs Janßen wrote:
On Tue, Aug 09, 2016 at 09:06:17PM -0400, Thomas Dickey wrote:
On Tue, Aug 09, 2016 at 04:10:07PM +0200, Corinna Vinschen wrote:
First of all, thanks to Corinna for reporting and giving such detailed descriptions and fixes and Thomas for commenting on them.
A Cygwin-specific workaround for both problems would be to change CF_XOPEN_SOURCE to use the same mechanism to set _GNU_SOURCE as on Linux etc, and to regenerate configure:
Even if that seems not to be the perfect way - as that might only break older cygwin installations (I just have cygwin 2.5.2 to test with) but no other systems, that's what I'll do for tin 2.4.0. I've updated the snapshots on the ftp-server.
Thank you. The newlib/Cygwin header file changes have been introduced earlier this year. As far as Cygwin is concerned, the new feature test macros are used since Cygwin 2.5.0.
In terms of older Cygwin releases, I tested with the pre-change Red Hat release 2.0.4rh-2 and it still builds tin-2.4.0 with this change, albeit with warnings:
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../include -I../pcre [...] \ -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE=600 [...] -c [...]/src/tmpfile.c <command-line>:0:0: warning: "_XOPEN_SOURCE" redefined <command-line>:0:0: note: this is the location of the previous definition
... but NO warnings in terms of missing declarations or some other hiccup. Corinna
On Wed, Aug 10, 2016 at 09:28:14AM +0200, Urs Janßen wrote:
On Tue, Aug 09, 2016 at 09:06:17PM -0400, Thomas Dickey wrote:
On Tue, Aug 09, 2016 at 04:10:07PM +0200, Corinna Vinschen wrote:
First of all, thanks to Corinna for reporting and giving such detailed descriptions and fixes and Thomas for commenting on them.
A Cygwin-specific workaround for both problems would be to change CF_XOPEN_SOURCE to use the same mechanism to set _GNU_SOURCE as on Linux etc, and to regenerate configure:
Even if that seems not to be the perfect way - as that might only break older cygwin installations (I just have cygwin 2.5.2 to test with) but no other systems, that's what I'll do for tin 2.4.0. I've updated the snapshots on the ftp-server.
sounds reasonable (I'll check too - I have an older cygwin). I've a few updates for the macros... -- Thomas E. Dickey <dickey@invisible-island.net> http://invisible-island.net ftp://invisible-island.net
On Wed, Aug 10, 2016 at 05:05:24AM -0400, Thomas Dickey wrote:
On Wed, Aug 10, 2016 at 09:28:14AM +0200, Urs Janßen wrote:
On Tue, Aug 09, 2016 at 09:06:17PM -0400, Thomas Dickey wrote:
On Tue, Aug 09, 2016 at 04:10:07PM +0200, Corinna Vinschen wrote:
First of all, thanks to Corinna for reporting and giving such detailed descriptions and fixes and Thomas for commenting on them.
A Cygwin-specific workaround for both problems would be to change CF_XOPEN_SOURCE to use the same mechanism to set _GNU_SOURCE as on Linux etc, and to regenerate configure:
Even if that seems not to be the perfect way - as that might only break older cygwin installations (I just have cygwin 2.5.2 to test with) but no other systems, that's what I'll do for tin 2.4.0. I've updated the snapshots on the ftp-server.
sounds reasonable (I'll check too - I have an older cygwin). I've a few updates for the macros...
Attaching a patch with updates for the macros, as well as some fixes to build with Solaris 10. -- Thomas E. Dickey <dickey@invisible-island.net> http://invisible-island.net ftp://invisible-island.net
participants (3)
-
Corinna Vinschen -
Thomas Dickey -
Urs Janßen