unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Preventing warnings in FIXNUM_OVERFLOW_P
Date: Fri, 19 Jan 2007 05:42:47 -0500	[thread overview]
Message-ID: <E1H7rCp-0001at-Mr@fencepost.gnu.org> (raw)
In-Reply-To: <85lkk0npzj.fsf@lola.goethe.zz> (message from David Kastrup on Thu, 18 Jan 2007 19:34:24 +0100)

    >     #define FIXNUM_OVERFLOW_P(i)					\
    >       ((unsigned long long)(i) > MOST_POSITIVE_FIXNUM		\
    >        && (unsigned long long)(i) < MOST_NEGATIVE_FIXNUM)
    >
    > Would someone please give that approach a try and see if it works?  I
    > am having too much trouble with concentration right now to see whether
    > that code is correct -- it might need somewhat more change than that
    > in order to get the comparisons right in an unsigned type.

    unsigned long long is neither guaranteed to exist on all supported
    architectures, nor guaranteed to be longer than long.

`unsigned long long' does always exist, when you are using GCC.  The
definition could be conditional on __GNUC__.

As for the whether `unsigned long long' may not be longer than `long',
why does that matter?

  parent reply	other threads:[~2007-01-19 10:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-18 17:27 Preventing warnings in FIXNUM_OVERFLOW_P Richard Stallman
2007-01-18 18:34 ` David Kastrup
2007-01-18 19:39   ` Stefan Monnier
2007-01-19 10:42     ` Richard Stallman
2007-01-19 11:50       ` Eli Zaretskii
2007-01-19 19:19         ` Stefan Monnier
2007-01-20  2:10           ` Richard Stallman
2007-01-20 13:45             ` Eli Zaretskii
2007-01-21  6:49               ` Richard Stallman
2007-01-19 10:42   ` Richard Stallman [this message]
2007-01-18 21:49 ` Eli Zaretskii
2007-01-19 10:43   ` Richard Stallman
2007-01-19 10:57     ` Eli Zaretskii
2007-01-20  2:10       ` Richard Stallman

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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=E1H7rCp-0001at-Mr@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).