diff options
| author | Paul Eggert | 2011-04-06 20:34:05 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-04-06 20:34:05 -0700 |
| commit | 5fdb398c4b75b0c834aff7132f90b0ce5317a25a (patch) | |
| tree | 29ebb8fc5700fefdd867fa497eac27fb7d0bcfe0 /src/ChangeLog | |
| parent | b189fa667ed7ac7b17f9665cd8a0c26316b3c521 (diff) | |
| download | emacs-5fdb398c4b75b0c834aff7132f90b0ce5317a25a.tar.gz emacs-5fdb398c4b75b0c834aff7132f90b0ce5317a25a.zip | |
error: Print 32- and 64-bit integers portably (Bug#8435).
Without this change, on typical 64-bit hosts error ("...%d...", N)
was used to print both 32- and 64-bit integers N, which relied on
undefined behavior.
* lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd):
New macro.
* lisp.h (error, verror): Mark as printf-like functions.
* eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
Report overflow in size calculations when allocating printf buffer.
Do not truncate output string at its first null byte.
* xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
Truncate the output at a character boundary, since vsnprintf does not
do that.
* charset.c (check_iso_charset_parameter): Convert internal
character to string before calling 'error', since %c now has the
printf meaning.
* coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
overflow when computing char to be passed to 'error'. Do not
pass Lisp_Object to 'error'; pass the integer instead.
* nsfns.m (Fns_do_applescript): Use int, not long, since it's
formatted with plain %d.
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6f2509429d2..c1bea6b4cc7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,27 @@ | |||
| 1 | 2011-04-07 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2011-04-07 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | error: Print 32- and 64-bit integers portably (Bug#8435). | ||
| 4 | Without this change, on typical 64-bit hosts error ("...%d...", N) | ||
| 5 | was used to print both 32- and 64-bit integers N, which relied on | ||
| 6 | undefined behavior. | ||
| 7 | * lisp.h, src/m/amdx86-64.h, src/m/ia64.h, src/m/ibms390x.h (pEd): | ||
| 8 | New macro. | ||
| 9 | * lisp.h (error, verror): Mark as printf-like functions. | ||
| 10 | * eval.c (verror): Use vsnprintf, not doprnt, to do the real work. | ||
| 11 | Report overflow in size calculations when allocating printf buffer. | ||
| 12 | Do not truncate output string at its first null byte. | ||
| 13 | * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work. | ||
| 14 | Truncate the output at a character boundary, since vsnprintf does not | ||
| 15 | do that. | ||
| 16 | * charset.c (check_iso_charset_parameter): Convert internal | ||
| 17 | character to string before calling 'error', since %c now has the | ||
| 18 | printf meaning. | ||
| 19 | * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int | ||
| 20 | overflow when computing char to be passed to 'error'. Do not | ||
| 21 | pass Lisp_Object to 'error'; pass the integer instead. | ||
| 22 | * nsfns.m (Fns_do_applescript): Use int, not long, since it's | ||
| 23 | formatted with plain %d. | ||
| 24 | |||
| 3 | * eval.c (internal_lisp_condition_case): Don't pass spurious arg. | 25 | * eval.c (internal_lisp_condition_case): Don't pass spurious arg. |
| 4 | 26 | ||
| 5 | * keyboard.c (access_keymap_keyremap): Print func name, not garbage. | 27 | * keyboard.c (access_keymap_keyremap): Print func name, not garbage. |