mirror of
https://github.com/fmtlib/fmt.git
synced 2025-07-30 02:37:36 +02:00
Remove unreachable code below FMT_THROW
This commit is contained in:
13
fmt/format.h
13
fmt/format.h
@ -237,7 +237,7 @@ typedef __int64 intmax_t;
|
|||||||
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
# define FMT_BUILTIN_CLZLL(n) __builtin_clzll(n)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Some compilers masquerade as both MSVC and GCC-likes or
|
// Some compilers masquerade as both MSVC and GCC-likes or
|
||||||
// otherwise support __builtin_clz and __builtin_clzll, so
|
// otherwise support __builtin_clz and __builtin_clzll, so
|
||||||
// only define FMT_BUILTIN_CLZ using the MSVC intrinsics
|
// only define FMT_BUILTIN_CLZ using the MSVC intrinsics
|
||||||
// if the clz and clzll builtins are not available.
|
// if the clz and clzll builtins are not available.
|
||||||
@ -253,7 +253,7 @@ inline uint32_t clz(uint32_t x) {
|
|||||||
|
|
||||||
assert(x != 0);
|
assert(x != 0);
|
||||||
// Static analysis complains about using uninitialized data
|
// Static analysis complains about using uninitialized data
|
||||||
// "r", but the only way that can happen is if "x" is 0,
|
// "r", but the only way that can happen is if "x" is 0,
|
||||||
// which the callers guarantee to not happen.
|
// which the callers guarantee to not happen.
|
||||||
# pragma warning(suppress: 6102)
|
# pragma warning(suppress: 6102)
|
||||||
return 31 - r;
|
return 31 - r;
|
||||||
@ -279,7 +279,7 @@ inline uint32_t clzll(uint64_t x) {
|
|||||||
|
|
||||||
assert(x != 0);
|
assert(x != 0);
|
||||||
// Static analysis complains about using uninitialized data
|
// Static analysis complains about using uninitialized data
|
||||||
// "r", but the only way that can happen is if "x" is 0,
|
// "r", but the only way that can happen is if "x" is 0,
|
||||||
// which the callers guarantee to not happen.
|
// which the callers guarantee to not happen.
|
||||||
# pragma warning(suppress: 6102)
|
# pragma warning(suppress: 6102)
|
||||||
return 63 - r;
|
return 63 - r;
|
||||||
@ -1296,7 +1296,7 @@ public:
|
|||||||
MakeArg() {
|
MakeArg() {
|
||||||
type = Arg::NONE;
|
type = Arg::NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
MakeArg(const T &value)
|
MakeArg(const T &value)
|
||||||
: Arg(MakeValue<Formatter>(value)) {
|
: Arg(MakeValue<Formatter>(value)) {
|
||||||
@ -2074,7 +2074,7 @@ struct ArgArray;
|
|||||||
template <unsigned N>
|
template <unsigned N>
|
||||||
struct ArgArray<N, true/*IsPacked*/> {
|
struct ArgArray<N, true/*IsPacked*/> {
|
||||||
typedef Value Type[N > 0 ? N : 1];
|
typedef Value Type[N > 0 ? N : 1];
|
||||||
|
|
||||||
template <typename Formatter, typename T>
|
template <typename Formatter, typename T>
|
||||||
static Value make(const T &value) {
|
static Value make(const T &value) {
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
@ -2272,7 +2272,7 @@ class SystemError : public internal::RuntimeError {
|
|||||||
Formats an error returned by an operating system or a language runtime,
|
Formats an error returned by an operating system or a language runtime,
|
||||||
for example a file opening error, and writes it to *out* in the following
|
for example a file opening error, and writes it to *out* in the following
|
||||||
form:
|
form:
|
||||||
|
|
||||||
.. parsed-literal::
|
.. parsed-literal::
|
||||||
*<message>*: *<system-message>*
|
*<message>*: *<system-message>*
|
||||||
|
|
||||||
@ -2614,7 +2614,6 @@ void BasicWriter<Char>::write_str(
|
|||||||
if (str_size == 0) {
|
if (str_size == 0) {
|
||||||
if (!str_value) {
|
if (!str_value) {
|
||||||
FMT_THROW(FormatError("string pointer is null"));
|
FMT_THROW(FormatError("string pointer is null"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::size_t precision = static_cast<std::size_t>(spec.precision_);
|
std::size_t precision = static_cast<std::size_t>(spec.precision_);
|
||||||
|
Reference in New Issue
Block a user