bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9000: patch for higher-resolution time stamps


From: Paul Eggert
Subject: bug#9000: patch for higher-resolution time stamps
Date: Sat, 23 Jun 2012 15:45:26 -0700
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

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.

Which version of GCC are you running?
What is INTMAX_MAX defined to, on your platform?

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

Or how about this?

static intmax_t intmax_max = INTMAX_MAX;
...    
      wait_reading_process_output (min (secs, intmax_max),
                                   EMACS_NSECS (t), 0, 0, Qnil, NULL, 0);

We could make this latter rewrite conditional only for older
GCC versions.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]