diff --git a/ctl/string.h b/ctl/string.h index a3488cd7a25..b2941588d1a 100644 --- a/ctl/string.h +++ b/ctl/string.h @@ -426,31 +426,31 @@ static_assert(sizeof(__::small_string) == __::string_size); static_assert(sizeof(__::big_string) == __::string_size); ctl::string -to_string(int); +to_string(int) noexcept; ctl::string -to_string(long); +to_string(long) noexcept; ctl::string -to_string(long long); +to_string(long long) noexcept; ctl::string -to_string(unsigned); +to_string(unsigned) noexcept; ctl::string -to_string(unsigned long); +to_string(unsigned long) noexcept; ctl::string -to_string(unsigned long long); +to_string(unsigned long long) noexcept; ctl::string -to_string(float); +to_string(float) noexcept; ctl::string -to_string(double); +to_string(double) noexcept; ctl::string -to_string(long double); +to_string(long double) noexcept; } // namespace ctl diff --git a/ctl/to_string.cc b/ctl/to_string.cc index fb54968e918..a66bb703149 100644 --- a/ctl/to_string.cc +++ b/ctl/to_string.cc @@ -27,49 +27,49 @@ namespace ctl { extern const double_conversion::DoubleToStringConverter kDoubleToPrintfG; string -to_string(int value) +to_string(int value) noexcept { char buf[12]; return { buf, FormatInt32(buf, value) - buf }; } string -to_string(unsigned value) +to_string(unsigned value) noexcept { char buf[12]; return { buf, FormatUint32(buf, value) - buf }; } string -to_string(long value) +to_string(long value) noexcept { char buf[21]; return { buf, FormatInt64(buf, value) - buf }; } string -to_string(unsigned long value) +to_string(unsigned long value) noexcept { char buf[21]; return { buf, FormatUint64(buf, value) - buf }; } string -to_string(long long value) +to_string(long long value) noexcept { char buf[21]; return { buf, FormatInt64(buf, value) - buf }; } string -to_string(unsigned long long value) +to_string(unsigned long long value) noexcept { char buf[21]; return { buf, FormatUint64(buf, value) - buf }; } string -to_string(float value) +to_string(float value) noexcept { char buf[128]; double_conversion::StringBuilder b(buf, sizeof(buf)); @@ -79,7 +79,7 @@ to_string(float value) } string -to_string(double value) +to_string(double value) noexcept { char buf[128]; double_conversion::StringBuilder b(buf, sizeof(buf)); @@ -89,7 +89,7 @@ to_string(double value) } string -to_string(long double value) +to_string(long double value) noexcept { #if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 1024 return to_string((double)value); diff --git a/test/ctl/to_string_test.cc b/test/ctl/to_string_test.cc index 8cba51e6003..69841c7ad59 100644 --- a/test/ctl/to_string_test.cc +++ b/test/ctl/to_string_test.cc @@ -17,7 +17,6 @@ // PERFORMANCE OF THIS SOFTWARE. #include "ctl/string.h" -#include "libc/intrin/kprintf.h" #include "libc/limits.h" #include "libc/math.h" #include "libc/mem/leaks.h"