musl/src/internal/intscan.c, branch master musl - an implementation of the standard library for Linux-based systems treat base 1 as an error in strtol-family functions 2017年01月05日T00:52:24+00:00 Rich Felker dalias@aerifal.cx 2017年01月05日T00:48:21+00:00 809ff8cf90254921ea38eb6fa1ce326d9008513b ISO C and POSIX only specify behavior for base arguments of 0 and 2-36; POSIX mandates an EINVAL error for unsupported bases. it's not clear that there's a requirement for implementations not to "support" additional bases as an extension, but "base 1" did not work in any meaningful way anyway, so it should be considered unsupported and thus an error.
ISO C and POSIX only specify behavior for base arguments of 0 and
2-36; POSIX mandates an EINVAL error for unsupported bases. it's not
clear that there's a requirement for implementations not to "support"
additional bases as an extension, but "base 1" did not work in any
meaningful way anyway, so it should be considered unsupported and thus
an error.
fix overflow corner case in strtoul-family functions 2014年09月16日T20:08:53+00:00 Rich Felker dalias@aerifal.cx 2014年09月16日T20:08:53+00:00 e2e1bb81485a37321d928a8d8b63f40b9d8fa228 incorrect behavior occurred only in cases where the input overflows unsigned long long, not just the (possibly lower) range limit for the result type. in this case, processing of the '-' sign character was not suppressed, and the function returned a value of 1 despite setting errno to ERANGE.
incorrect behavior occurred only in cases where the input overflows
unsigned long long, not just the (possibly lower) range limit for the
result type. in this case, processing of the '-' sign character was
not suppressed, and the function returned a value of 1 despite setting
errno to ERANGE.
clean up stdio_impl.h 2012年11月08日T21:39:41+00:00 Rich Felker dalias@aerifal.cx 2012年11月08日T21:39:41+00:00 835f9f950e2f6059532bd9ab9857a856ed21a4fd this header evolved to facilitate the extremely lazy practice of omitting explicit includes of the necessary headers in individual stdio source files; not only was this sloppy, but it also increased build time. now, stdio_impl.h is only including the headers it needs for its own use; any further headers needed by source files are included directly where needed.
this header evolved to facilitate the extremely lazy practice of
omitting explicit includes of the necessary headers in individual
stdio source files; not only was this sloppy, but it also increased
build time.
now, stdio_impl.h is only including the headers it needs for its own
use; any further headers needed by source files are included directly
where needed.
fix really bad breakage in strtol, etc.: failure to accept leading spaces 2012年04月19日T16:47:34+00:00 Rich Felker dalias@aerifal.cx 2012年04月19日T16:47:34+00:00 cb81b6947c0277a6a27ddc699d716e9cf2b524aa
fix failure of int parser to unget an initial mismatching character 2012年04月18日T01:17:19+00:00 Rich Felker dalias@aerifal.cx 2012年04月18日T01:17:19+00:00 bb477f9fd4a69bac77c70d2099272ee1ac17e62c
new scanf implementation and corresponding integer parser/converter 2012年04月16日T20:03:45+00:00 Rich Felker dalias@aerifal.cx 2012年04月16日T20:03:45+00:00 18efeb320b763e541a7dbf61a7da1cbe13ab2be9 advantages over the old code: - correct results for floating point (old code was bogus) - wide/regular scanf separated so scanf does not pull in wide code - well-defined behavior on integers that overflow dest type - support for %[a-b] ranges with %[ (impl-defined by widely used) - no intermediate conversion of fmt string to wide string - cleaner, easier to share code with strto* functions - better standards conformance for corner cases the old code remains in the source tree, as the wide versions of the scanf-family functions are still using it. it will be removed when no longer needed.
advantages over the old code:
- correct results for floating point (old code was bogus)
- wide/regular scanf separated so scanf does not pull in wide code
- well-defined behavior on integers that overflow dest type
- support for %[a-b] ranges with %[ (impl-defined by widely used)
- no intermediate conversion of fmt string to wide string
- cleaner, easier to share code with strto* functions
- better standards conformance for corner cases
the old code remains in the source tree, as the wide versions of the
scanf-family functions are still using it. it will be removed when no
longer needed.

AltStyle によって変換されたページ (->オリジナル) /