bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Re: [PATCH] regex: port to Gawk on nonstandard platforms
@ 2020-01-26  9:42 arnold
  2020-01-27 21:09 ` Paul Eggert
  0 siblings, 1 reply; 3+ messages in thread
From: arnold @ 2020-01-26  9:42 UTC (permalink / raw)
  To: eggert; +Cc: bug-gnulib

Hi. Paul.

> diff --git a/lib/regex_internal.h b/lib/regex_internal.h
> index 13e15e21e..6d436fde1 100644
> --- a/lib/regex_internal.h
> +++ b/lib/regex_internal.h
> @@ -141,6 +141,9 @@
>  #ifndef SSIZE_MAX
>  # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
>  #endif
> +#ifndef ULONG_WIDTH
> +# define ULONG_WIDTH (CHAR_BIT * sizeof (unsigned long int))
> +#endif
>  
>  /* The type of indexes into strings.  This is signed, not size_t,
>     since the API requires indexes to fit in regoff_t anyway, and using

This change is problematic.  Further on in regex_internal.h we
have

	#define BITSET_WORD_BITS ULONG_WIDTH

And then in places in regcomp.c BITSET_WORD_BITS is tested in
several #if/#elif statements.

Thus on systems that don't provide ULONG_WIDTH, we end up with
expressions in #if/#elif that wants to use sizeof.

Needless to say, this fails spectactularly. :-(

Can you revert to the original code or to something else that
will compile on systems where ULONG_WIDTH is not defined?

Much thanks,

Arnold


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-28  7:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-26  9:42 [PATCH] regex: port to Gawk on nonstandard platforms arnold
2020-01-27 21:09 ` Paul Eggert
2020-01-28  7:41   ` arnold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).