Change #237968
Category | gcoreutils |
Changed by | Paul Eggert <eggert | @cs.ucla.edu>
Changed at | Sun 29 Jun 2025 06:00:41 |
Repository | git://git.savannah.gnu.org/coreutils.git |
Project | gcoreutils |
Branch | master |
Revision | 3ad59e19bc289b41c7998f91eda424672b2c8497 |
Comments
od: replace lookup tables with simple arithmetic * src/od.c (FMT_BYTES_ALLOCATED): Use a simpler formula. Although slightly too generous, the storage wasted is very small and it pacifies gcc -Wformat-overflow=2. (bytes_to_oct_digits, bytes_to_signed_dec_digits) (bytes_to_unsigned_dec_digits, bytes_to_hex_digoits): Remove. All uses replaced by algorithmic calculations, which are good enough: they are valid for integers up to 2620 bits (!) and might be slightly conservative for wider integers. Remove related static_asserts, which are no longer needed.
Changed files
- src/od.c