Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Test failure with negative substring offsets

On 23 May 2011 18:10, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On May 23,  4:56pm, Peter Stephenson wrote:
> }
> } stdarg doesn't know the arguments need to be converted to integers to
> } fit the size being claimed in the printf prototype.

This is a much better conclusion than mine.

> Er, wouldn't it therefore have been better to change the prototype to
> expect a long?

It doesn't expect a long, it expects a zlong, which can be a long or a
long long.

#ifdef ZSH_64_BIT_TYPE
typedef ZSH_64_BIT_TYPE zlong;
#ifdef ZSH_64_BIT_UTYPE
typedef ZSH_64_BIT_UTYPE zulong;
typedef unsigned zlong zulong;
typedef long zlong;
typedef unsigned long zulong;

But why does this code use zlong at all? 2^31 characters should be
long enough for everyone. (And things will probably fall over for
other reasons before that point, no?) But maybe the autoconf macro
could define a ZSH_PRINTF_SPECIFIER to %ld or %lld depending on what
zlong is?

Mikael Magnusson

Messages sorted by: Reverse Date, Date, Thread, Author