From: Eli Zaretskii <eliz@gnu.org>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: cyd@stupidchicken.com, emacs-devel@gnu.org
Subject: Re: Intervals crash
Date: Fri, 24 Sep 2010 10:16:01 +0200 [thread overview]
Message-ID: <83iq1vtv3y.fsf@gnu.org> (raw)
In-Reply-To: <87bp7n3c19.fsf@uwakimon.sk.tsukuba.ac.jp>
> From: "Stephen J. Turnbull" <stephen@xemacs.org>
> Cc: Chong Yidong <cyd@stupidchicken.com>,
> emacs-devel@gnu.org
> Date: Fri, 24 Sep 2010 15:12:34 +0900
>
> > I'd rather fix it properly. I replaced all EMACS_UINT with
> > EMACS_INT in intervals.c, it couldn't be worse than int it used
> > before.
>
> You should just do that everywhere. EMACS_UINT is a bad idea, and
> should be avoided.
Easier said then done, for someone such as myself, with very limited
resources. I used EMACS_UINT because the related data structure used
it for some of its members. I didn't have time to study the code
enough to understand whether it was really needed, but the change
which introduced it was deliberate, so I trusted that whoever did it
had good reasons.
> First, unsigned-ness tends to propagate because of C coercion rules,
> which is rarely desired
Funny that you should mention it, because I used EMACS_UINT precisely
to avoid such problems (comparison of signed and unsigned), given that
some struct members were unsigned.
> The conclusion is that unsigneds (eg, size_t's) should be treated the
> same way you treat legacy-encoded external text input: hazardous
> material that you should convert to some sane internal type as soon as
> possible, and to be produced only just before use in external APIs.
> As such, there's really no need for EMACS_UINT.
If you really need the full range of size_t or EMACS_UINT, there's
little you can do in practice.
next prev parent reply other threads:[~2010-09-24 8:16 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-23 18:23 Intervals crash Chong Yidong
2010-09-23 18:52 ` Chong Yidong
2010-09-23 19:01 ` Eli Zaretskii
2010-09-23 19:09 ` Chong Yidong
2010-09-23 19:32 ` Eli Zaretskii
2010-09-23 18:57 ` Eli Zaretskii
2010-09-24 6:12 ` Stephen J. Turnbull
2010-09-24 8:16 ` Eli Zaretskii [this message]
2010-09-24 8:52 ` Stephen J. Turnbull
2010-09-24 10:03 ` Eli Zaretskii
2010-09-25 14:34 ` Stephen J. Turnbull
2010-09-25 16:10 ` Eli Zaretskii
2010-09-25 18:54 ` Stephen J. Turnbull
2010-09-25 22:07 ` Eli Zaretskii
2010-09-26 13:08 ` Stephen J. Turnbull
2010-09-26 19:22 ` Miles Bader
2010-09-26 19:33 ` David Kastrup
2010-09-27 4:53 ` Stephen J. Turnbull
2010-09-27 6:55 ` David Kastrup
2010-09-27 7:42 ` Jan Djärv
2010-09-27 8:34 ` Eli Zaretskii
2010-09-27 9:02 ` David Kastrup
2010-09-27 11:02 ` Eli Zaretskii
2010-09-27 8:36 ` Eli Zaretskii
2010-09-27 8:50 ` Stephen J. Turnbull
2010-09-27 9:39 ` David Kastrup
2010-09-27 9:45 ` Lars Magne Ingebrigtsen
2010-09-27 10:11 ` Stephen J. Turnbull
2010-09-24 10:31 ` Eli Zaretskii
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83iq1vtv3y.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=cyd@stupidchicken.com \
--cc=emacs-devel@gnu.org \
--cc=stephen@xemacs.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.