emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 265cee5 1/3: Work around GCC bug 80776 on Fedora


From: Paul Eggert
Subject: [Emacs-diffs] emacs-26 265cee5 1/3: Work around GCC bug 80776 on Fedora 27 x86
Date: Sun, 26 Nov 2017 01:48:21 -0500 (EST)

branch: emacs-26
commit 265cee553f9d59a989d92e28865f6cc6fc02dcc9
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Work around GCC bug 80776 on Fedora 27 x86
    
    * src/buffer.c (Fgenerate_new_buffer_name): Pacify GCC 7.2.1
    20170915 (Red Hat 7.2.1-2) on i686 with -Wformat-overflow -O2 by
    using XINT rather than XFASTINT and by adding an eassume.  This
    works around GCC bug 80776.
---
 src/buffer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/buffer.c b/src/buffer.c
index d1c4138..6e3412c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -1087,7 +1087,11 @@ is first appended to NAME, to speed up finding a 
non-existent buffer.  */)
   else
     {
       char number[sizeof "-999999"];
-      int i = XFASTINT (Frandom (make_number (999999)));
+
+      /* Use XINT instead of XFASTINT to work around GCC bug 80776.  */
+      int i = XINT (Frandom (make_number (1000000)));
+      eassume (0 <= i && i < 1000000);
+
       AUTO_STRING_WITH_LEN (lnumber, number, sprintf (number, "-%d", i));
       genbase = concat2 (name, lnumber);
       if (NILP (Fget_buffer (genbase)))



reply via email to

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