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

Re: numeric brace expansion



> You should be able to fix this just by altering prototypes.h and
> compat.c to add a `const' to the first argument of strtol(), which is
> what gcc is worried about: it doesn't really care if the const is
> there or not, but if it is in one prototype it needs to be there in
> any other.  I think the following is the ANSI/ISO prototype anyway,
> but it looks like the zsh code avoids using `const' in prototypes
> probably to avoid breaking older compilers.  Does ansi2knr not handle
> const's?  We could always do the
> 
> #ifdef __STDC__
> #define CONST const
> #else
> #define CONST
> #endif

I already have configure (autoconf) set to check whether a
system's compiler supports const.  If a system doesn't support
const, then config.h will define const to empty.

So using const in the zsh code shouldn't cause any portability
problems.  It might be useful to add const some of the string
handling functions in zsh.

Richard Coleman
zsh@xxxxxxxxxxxxxxx



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