diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-24 22:37:11 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-24 22:41:56 -0700 |
commit | 52ba851db188de47b303120df00c77e3aad7e542 (patch) | |
tree | fd7e6c3e4519b309b1b6c4d26c5d6465b0498fbf /src/print.c | |
parent | 5933886920fefe800747baf7863685b9dc961d83 (diff) | |
download | emacs-52ba851db188de47b303120df00c77e3aad7e542.tar.gz |
Port --enable-gcc-warnings to GCC 5.1 x86-64
* lib-src/ebrowse.c (dump_sym):
* lib-src/hexl.c (main):
* src/ccl.c (ccl_driver):
* src/character.c (string_escape_byte8):
* src/dbusbind.c (xd_retrieve_arg, xd_add_watch):
* src/gnutls.c (Fgnutls_boot):
* src/gtkutil.c (xg_check_special_colors):
* src/image.c (x_build_heuristic_mask):
* src/print.c (safe_debug_print, print_object):
* src/term.c (produce_glyphless_glyph):
* src/xdisp.c (get_next_display_element)
(produce_glyphless_glyph):
* src/xterm.c (x_draw_glyphless_glyph_string_foreground):
Don't use a signed format to print an unsigned integer, or vice
versa. GCC 5.1's new -Wformat-signedness option warns about this.
* src/image.c (png_load_body, jpeg_load_body):
Silence a bogus setjump diagnostic from GCC 5.1 (GCC bug 54561).
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/print.c b/src/print.c index bff5932c1d1..206466ce68f 100644 --- a/src/print.c +++ b/src/print.c @@ -794,9 +794,12 @@ safe_debug_print (Lisp_Object arg) if (valid > 0) debug_print (arg); else - fprintf (stderr, "#<%s_LISP_OBJECT 0x%08"pI"x>\r\n", - !valid ? "INVALID" : "SOME", - XLI (arg)); + { + EMACS_UINT n = XLI (arg); + fprintf (stderr, "#<%s_LISP_OBJECT 0x%08"pI"x>\r\n", + !valid ? "INVALID" : "SOME", + n); + } } @@ -1422,7 +1425,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) print single-byte non-ASCII string chars using octal escapes. */ char outbuf[5]; - int len = sprintf (outbuf, "\\%03o", c); + int len = sprintf (outbuf, "\\%03o", c + 0u); strout (outbuf, len, len, printcharfun); need_nonhex = false; } @@ -1431,7 +1434,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) { /* When requested, print multibyte chars using hex escapes. */ char outbuf[sizeof "\\x" + INT_STRLEN_BOUND (c)]; - int len = sprintf (outbuf, "\\x%04x", c); + int len = sprintf (outbuf, "\\x%04x", c + 0u); strout (outbuf, len, len, printcharfun); need_nonhex = true; } @@ -2094,11 +2097,11 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) Probably should just emacs_abort (). */ print_c_string ("#<EMACS BUG: INVALID DATATYPE ", printcharfun); if (MISCP (obj)) - len = sprintf (buf, "(MISC 0x%04x)", (int) XMISCTYPE (obj)); + len = sprintf (buf, "(MISC 0x%04x)", (unsigned) XMISCTYPE (obj)); else if (VECTORLIKEP (obj)) - len = sprintf (buf, "(PVEC 0x%08"pD"x)", ASIZE (obj)); + len = sprintf (buf, "(PVEC 0x%08zx)", (size_t) ASIZE (obj)); else - len = sprintf (buf, "(0x%02x)", (int) XTYPE (obj)); + len = sprintf (buf, "(0x%02x)", (unsigned) XTYPE (obj)); strout (buf, len, len, printcharfun); print_c_string ((" Save your buffers immediately" " and please report this bug>"), |