1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-04 11:40:22 +00:00

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.
This commit is contained in:
Paul Eggert 2017-11-25 16:11:43 -08:00
parent dc7a97fb84
commit 265cee553f

View File

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