summaryrefslogtreecommitdiff
path: root/include/string.h
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-12-02 15:18:05 -0500
committerRich Felker <dalias@aerifal.cx>2012-12-02 15:18:05 -0500
commit216b706548c16e3bc9612c8a2e5eed23f016504c (patch)
treede96295a1d3903657bc237b849b7438657309388 /include/string.h
parent7dcb640da361f272a6c317b03466fd2013934c81 (diff)
downloadmusl-216b706548c16e3bc9612c8a2e5eed23f016504c.tar.gz
fix a couple issues in the inttypes.h PRI/SCN macros
most importantly, the format/scan macros for the [u]int_fast16_t and [u]int_fast32_t types were defined incorrectly assuming these types would match the native word/pointer size. this is incorrect on any 64-bit system; the "fast" types for 16- and 32-bit integers are simply int. another issue which was "only a warning" (despite being UB) is that the choice of "l" versus "ll" was incorrect for 64-bit types on 64-bit machines. while it would "work" to always use "long long" for 64-bit types, we use "long" on 64-bit machines to match what glibc does and what the ABI documents recommend. the macro definitions were probably right in very old versions of musl, but became wrong when we aligned most closely with the 'standard' ABI. checking UINTPTR_MAX is an easy way to get the system wordsize without pulling in new headers. finally, the useless __PRIPTR macro to allow the underlying type of [u]intptr_t to vary has been removed. we are using "long" on all targets, and thankfully this matches what glibc does, so I do not envision ever needing to change it. thus, the "l" has just been incorporated directly in the strings.
Diffstat (limited to 'include/string.h')
0 files changed, 0 insertions, 0 deletions