bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: arnold@skeeve.com
To: jim@meyering.net, eggert@cs.ucla.edu, arnold@skeeve.com
Cc: 34951@debbugs.gnu.org, bug-gnulib@gnu.org, noritnk@kcn.ne.jp
Subject: Re: bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher
Date: Sun, 15 Dec 2019 01:14:24 -0700	[thread overview]
Message-ID: <201912150814.xBF8EOXW005059@freefriends.org> (raw)
In-Reply-To: <20db9cb5-da09-fe26-f7fc-884fc194daaa@cs.ucla.edu>

OK. I skimmed the links.  But why not write the code to say what
we mean?  For example:

	#include <stdint.h>
	typedef int64_t dfa_size_t;

	extern void dfaparse (char const *, dfa_size_t, struct dfa *);
	extern void dfacomp (char const *, dfa_size_t, struct dfa *, bool);
			      bool allow_nl, dfa_size_t *count, bool *backref);

Using ptrdiff_t directly simply because it is defined to be the
largest signed integer remains ugly (and Paul has already moved to
a typedef in the implementation.)

int64_t is just as standard as ptrdiff_t and just as clear.

Thanks,

Arnold

Paul Eggert <eggert@cs.ucla.edu> wrote:

> >> I see that Paul has made the change to the API over my objections.
>
> I made the change while responding to Bruno's objections, but before 
> seeing yours. Ooops. Sorry about that. However, I hope the followup 
> emails have addressed your comments, at least to some extent.
>
> > Paul, can you point to a link that lists the benefits/tradeoffs? If I
> > had such a link handy, I would have provided it here.
>
> Avoiding unsigned types for indexes and sizes seems to be a growing 
> movement. Admittedly there are arguments for unsigned, but these 
> arguments are getting weaker with time. Here are a couple of links, the 
> first for C and the second for C++:
>
> https://www.gnu.org/software/emacs/manual/html_node/elisp/C-Integer-Types.html
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1428r0.pdf
>
> As for ssize_t vs ptrdiff_t: ssize_t is less central to the C language 
> (ptrdiff_t is in the C standard but ssize_t is not). And ssize_t is less 
> convenient: for example, there's no simple, portable way to printf an 
> ssize_t value, as there is with "%td" and ptrdiff_t. So there are 
> technical reasons for preferring ptrdiff_t to ssize_t for this sort of 
> thing (even though "ssize_t" is a shorter and better name). Thich is why 
> Emacs, other parts of Gnulib, and other Gnu applications have used 
> ptrdiff_t instead of ssize_t for this sort of thing.


  parent reply	other threads:[~2019-12-15  8:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-22 23:06 [PATCH] grep: a kwset matcher not work in a grep matcher Norihiro Tanaka
2019-03-23  2:49 ` bug#34951: " Norihiro Tanaka
2019-03-23  2:58   ` Budi
2019-03-23  2:59     ` Budi
2019-03-23 12:39       ` Eric Blake
2019-03-29 10:58   ` arnold
2019-12-11 23:25   ` Paul Eggert
2019-12-12  7:23     ` arnold
2019-12-12  7:31     ` arnold
2019-12-12  7:47       ` arnold
2019-12-12 22:26       ` Paul Eggert
2019-12-13  8:09         ` arnold
2019-12-13 12:08           ` arnold
2019-12-13 17:53             ` Jim Meyering
2019-12-13 20:00               ` Paul Eggert
2019-12-14  2:35                 ` intptr_t vs. uintptr_t Bruno Haible
2019-12-14  3:19                   ` Paul Eggert
2019-12-14  9:14                     ` Bruno Haible
2019-12-14 22:29                       ` Paul Eggert
2019-12-15  0:35                         ` Bruno Haible
2019-12-16 10:02                           ` Paul Eggert
2019-12-15  8:14                 ` arnold [this message]
2019-12-16  9:56                   ` bug#34951: [PATCH] grep: a kwset matcher not work in a grep matcher Paul Eggert
2019-12-16 10:12                     ` arnold
2019-12-20  3:18                       ` Paul Eggert
2019-12-20 10:35                         ` arnold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201912150814.xBF8EOXW005059@freefriends.org \
    --to=arnold@skeeve.com \
    --cc=34951@debbugs.gnu.org \
    --cc=bug-gnulib@gnu.org \
    --cc=eggert@cs.ucla.edu \
    --cc=jim@meyering.net \
    --cc=noritnk@kcn.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).