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

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

bug#32252: [PATCH] %o and %x now format signed numbers


From: Paul Eggert
Subject: bug#32252: [PATCH] %o and %x now format signed numbers
Date: Mon, 23 Jul 2018 16:39:08 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

Why breaking longstanding behavior instead of introducing this with a
different format specifier.  Like %a.

Although it is indeed an incompatible change, I surveyed the existing Emacs source code and couldn't find anything that the change would break. Almost all uses of %x, %X, and %o were with nonnegative integers where the behavior would not change. In the few places I found where the integers could be negative, the resulting strings were things like nonces where the change didn't break anything. Of course I could have missed some uses, and there are uses outside of Emacs source code; still, it seems that this change would break very little user code (and the rare users who might run into a problem have a simple workaround).

%a has quite a different meaning in C11, so we'd need to use some other letter (or set of letters, if we want something for %x, %X, %o) if we went that route. This seems like overkill for such a small change to functionality that hardly ever matters; plus, %x, %X and %o would continue to have problematic machine-dependent semantics and would not be sensibly extensible to bignums.






reply via email to

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