bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#8435: misuse of error ("...%d...", ...) on 64-bit hosts


From: Eli Zaretskii
Subject: bug#8435: misuse of error ("...%d...", ...) on 64-bit hosts
Date: Thu, 07 Apr 2011 21:31:55 +0300

> Date: Thu, 07 Apr 2011 00:33:44 -0700
> From: Paul Eggert <eggert@cs.ucla.edu>
> 
> This patch assumes that vsnprintf works.

Bother: using `vsnprintf' here could cause problems when `error' is
used to format messages with non-ASCII characters.  `doprnt' was
careful in these cases, e.g., it would take care of truncating
multibyte strings only on character boundaries.  It also supported %c
format for converting a multibyte character to its integer
representation.  Can we trust `vsnprintf' to not misbehave in these
cases, and DTRT with the entire repertory of characters supported by
Emacs?

There's also an issue with old pre-C99 implementations of `vsnprintf'
which returned -1 when the buffer was too small.  However, I think
catering for those would be a trivial change in `verror', so that's
not a big deal.

> I assume that vsnprintf works on Windows, so the presence or absence
> of the vsnprintf module shouldn't matter for Windows.

Yes, the MinGW build will have no problem.  The MSVC build will need
the above-mentioned change in `verror', because the Microsoft
runtime's version of `vsnprintf' is not compatible with ISO C99.  But
that can be fixed later, if needed.





reply via email to

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