[Tcsh] tcsh-6.24.14 is now available

Dr. Werner Fink werner at suse.de
Thu Nov 28 14:24:50 UTC 2024


On 2024/11/28 08:57:18 -0500, Christos Zoulas wrote:
> Is this caused by a typo?
> 
> diff --git a/sh.file.c b/sh.file.c
> index c6742c4c..35a29726 100644
> --- a/sh.file.c
> +++ b/sh.file.c
> @@ -590,7 +590,7 @@ again:                              /* search for matches */
>  static int
>  compare(const void *p, const void *q)
>  {
> -#if defined (WIDE_STRINGS) && !defined (UTF16_STRING)
> +#if defined (WIDE_STRINGS) && !defined (UTF16_STRINGS)
>      errno = 0;
>  
>      return (wcscoll(*(Char *const *) p, *(Char *const *) q));

This makes it build on x86_64 as well as on i586 yesy ... nevertheless
the type of Char is an unsigned int whereas xprintf() and xasprintf()
expect wchar_t hence I see warnings on 32bit.

Werner

> > This breaks build on 32bit architectures:
> > 
> > diff -urp tcsh-6.24.13/config_f.h tcsh-6.24.14/config_f.h
> > --- tcsh-6.24.13/config_f.h     2024-06-12 09:47:58.753288937 +0200
> > +++ tcsh-6.24.14/config_f.h     2024-11-28 09:44:03.712332824 +0100
> > @@ -64,7 +64,7 @@
> >  */
> > #if defined (SHORT_STRINGS) && defined (NLS) && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX) && SIZEOF_WCHAR_T > 1
> > # define WIDE_STRINGS
> > -# if SIZEOF_WCHAR_T < 4
> > +# if SIZEOF_WCHAR_T <= 4
> > #  define UTF16_STRINGS
> > # endif
> > #endif
> > 
> > now we have
> > 
> > 
> > [   18s] sh.file.c: In function ‘compare’:
> > [   18s] sh.file.c:596:21: error: passing argument 1 of ‘wcscoll’ from incompatible pointer type [-Wincompatible-pointer-types]
> > [   18s]   596 |     return (wcscoll(*(Char *const *) p, *(Char *const *) q));
> > [   18s]       |                     ^~~~~~~~~~~~~~~~~~
> > [   18s]       |                     |
> > [   18s]       |                     Char * {aka unsigned int *}
> > [   18s]       |                                         Char * {aka unsigned int *}
> > [   18s] /usr/include/wchar.h:155:57: note: expected ‘const wchar_t *’ {aka ‘const long int *’} but argument is of type ‘Char *’ {aka ‘unsigned int *’}
> > [   18s]   155 | extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) __THROW;
> > 
> > 
> > to be honest I do/can not care about S-JIS in comparision to modern UTF-8

[  154s] sh.dir.c: In function ‘printdirs’:
[  154s] sh.dir.c:286:21: warning: format ‘%S’ expects argument of type ‘wchar_t *’, but argument 2 has type ‘Char *’ {aka ‘unsigned int *’} [-Wformat=]
[  154s]   286 |             xprintf("~%" TCSH_S, user);
[  154s]       |                     ^~~~         ~~~~
[  154s]       |                                  |
[  154s]       |                                  Char * {aka unsigned int *}

[  155s] tc.vers.c: In function ‘fix_version’:
[  155s] tc.vers.c:159:1: warning: format ‘%S’ expects argument of type ‘wchar_t *’, but argument 7 has type ‘const Char *’ {aka ‘const unsigned int *’} [-Wformat=]
[  155s]   159 | "tcsh %d.%.2d.%.2d (%s) %s (%" TCSH_S "-%" TCSH_S "-%" TCSH_S ") options %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
[  155s]       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[  155s]   160 |              REV, VERS, PATCHLEVEL, ORIGIN, DATE, machtype, vendor, ostype,
[  155s]       |                                                   ~~~~~~~~
[  155s]       |                                                   |
[  155s]       |                                                   const Char * {aka const unsigned int *}


-- 
 Dr. Werner Fink -- Software Engineer Consultant
 SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nürnberg,
 Germany, GF: Ivo Totev, Andrew McDonald, Werner Knoblich,
 DE 322 919 152, HRB 36809 (AG Nürnberg), 
 phone: +49-911-740-53-0,  fax: +49-911-3206727,  www.suse.com
---------------------------------------------------------------------------
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 894 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/tcsh/attachments/20241128/d3f904a1/attachment.asc>


More information about the Tcsh mailing list