diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-11-25 16:11:43 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-11-25 22:48:09 -0800 |
commit | 265cee553f9d59a989d92e28865f6cc6fc02dcc9 (patch) | |
tree | 8323e09f84d004f2716cad2b2faa3072f5ce3bfe /src | |
parent | dc7a97fb846cbec16a198d95903ae7a85916da9d (diff) | |
download | emacs-265cee553f9d59a989d92e28865f6cc6fc02dcc9.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/buffer.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buffer.c b/src/buffer.c index d1c41380188..6e3412c3d05 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))) |