From: Eli Zaretskii <eliz@gnu.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 9000@debbugs.gnu.org
Subject: bug#9000: patch for higher-resolution time stamps
Date: Sun, 24 Jun 2012 05:57:57 +0300 [thread overview]
Message-ID: <83fw9lbemi.fsf@gnu.org> (raw)
In-Reply-To: <4FE64706.4030807@cs.ucla.edu>
> Date: Sat, 23 Jun 2012 15:45:26 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> CC: 9000@debbugs.gnu.org
>
> On 06/23/2012 12:42 PM, Eli Zaretskii wrote:
> > Never mind, I fixed that myself.
>
> Unfortunately the patch that you installed can break
> Emacs on hosts where time_t is unsigned, because
> it assigns time_t values to intmax_t variables,
> and this does not always work correctly when
> INTMAX_MAX < TIME_T_MAX.
We could use (UINTMAX_MAX / 2) instead, would that work?
> Which version of GCC are you running?
3.4.2
> What is INTMAX_MAX defined to, on your platform?
It is defined to INT64_MAX (i.e., 9223372036854775807LL). The problem
is that EMACS_SECS returns a time_t, a 32-bit value, whereas
INTMAX_MAX is a 64-bit value.
> Does it work to pacify your old GCC if you
> replace this:
>
> intmax_t secs = EMACS_SECS (t);
>
> wait_reading_process_output (min (secs, INTMAX_MAX),
> EMACS_NSECS (t), 0, 0, Qnil, NULL, 0);
>
> with this?
>
> intmax_t max = INTMAX_MAX;
>
> wait_reading_process_output (min (secs, max),
> EMACS_NSECS (t), 0, 0, Qnil, NULL, 0);
You don't show what is 'secs' in this snippet. The key to avoiding
the warning is to have both arguments of 'min' be 64-bit values.
next prev parent reply other threads:[~2012-06-24 2:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-05 6:40 bug#9000: patch for higher-resolution time stamps Paul Eggert
2011-07-05 6:57 ` bug#9000: More-compatible proposal, using (HIGH LOW USEC PSEC) " Paul Eggert
2011-07-06 17:00 ` bug#9000: Update time patch for Frandom, pthread_sigmask, etc Paul Eggert
2012-05-04 20:52 ` bug#9000: 2012-05-04 version of patch Paul Eggert
2012-05-27 3:08 ` Paul Eggert
2012-06-22 21:21 ` bug#9000: patch for higher-resolution time stamps Paul Eggert
2012-06-23 8:39 ` Eli Zaretskii
2012-06-23 10:48 ` Eli Zaretskii
2012-06-23 17:57 ` Paul Eggert
2012-06-23 19:09 ` Eli Zaretskii
2012-06-23 19:42 ` Eli Zaretskii
2012-06-23 22:45 ` Paul Eggert
2012-06-24 2:57 ` Eli Zaretskii [this message]
2012-06-24 4:31 ` Paul Eggert
2012-06-24 19:26 ` Eli Zaretskii
2012-06-23 18:55 ` Paul Eggert
2012-06-23 19:08 ` Eli Zaretskii
2012-06-23 22:34 ` Paul Eggert
2012-06-24 17:23 ` 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=83fw9lbemi.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=9000@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/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.