ArgList(ArgList &other) { va_copy(this->vlist, other.vlist); }
~ArgList() { va_end(this->vlist); }
+ ArgList &operator=(ArgList &rhs) {
+ va_copy(vlist, rhs.vlist);
+ return *this;
+ }
+
template <class T> T inline next_var() { return va_arg(vlist, T); }
};
}
template <>
-constexpr bool FloatToString<long double>::is_lowest_block(size_t block_index) {
- return block_index < 0;
+constexpr bool FloatToString<long double>::is_lowest_block(size_t) {
+ return false;
}
template <>
fputil::DoubleDouble mx{/*lo*/ 0.0, /*hi*/ m_x};
// Further range reductions.
- int idx[R_STEPS];
double scale = 0x1.0p+7;
const fputil::DyadicFloat<128> NEG_ONE(-1.0);
for (size_t i = 0; i < R_STEPS; ++i) {
scale *= 0x1.0p+4;
int id = static_cast<int>(fputil::multiply_add(mx.hi, scale, 0x1.0p+4));
- idx[i] = id;
double r = RR[i][id];
fputil::DoubleDouble rm = fputil::exact_mult(r, mx.hi);
rm.hi += r - 1.0;
case LengthModifier::j:
return num; // j is intmax, so no mask is necessary.
}
+ __builtin_unreachable();
}
#define RET_IF_RESULT_NEGATIVE(func) \
#include <stdio.h>
-extern "C" FILE *stderr = reinterpret_cast<FILE *>(__llvm_libc::stderr);
+extern "C" {
+FILE *stderr = reinterpret_cast<FILE *>(__llvm_libc::stderr);
+}
#include <stdio.h>
-extern "C" FILE *stdin = reinterpret_cast<FILE *>(__llvm_libc::stdin);
+extern "C" {
+FILE *stdin = reinterpret_cast<FILE *>(__llvm_libc::stdin);
+}
#include <stdio.h>
-extern "C" FILE *stdout = reinterpret_cast<FILE *>(__llvm_libc::stdout);
+extern "C" {
+FILE *stdout = reinterpret_cast<FILE *>(__llvm_libc::stdout);
+}
namespace __llvm_libc {
// This is initialized to the correct value by the statup code.
-extern "C" char **environ = nullptr;
+extern "C" {
+char **environ = nullptr;
+}
} // namespace __llvm_libc
namespace impl {
-extern "C" char *optarg = nullptr;
-extern "C" int optind = 1;
-extern "C" int optopt = 0;
-extern "C" int opterr = 0;
+extern "C" {
+
+char *optarg = nullptr;
+int optind = 1;
+int optopt = 0;
+int opterr = 0;
+
+}
static unsigned optpos;
// compilers can generate code assuming the alignment as required by the ABI.
// If the stack pointers as setup by the OS are already aligned, then the
// following code is a NOP.
- __asm__ __volatile__("andq $0xfffffffffffffff0, %%rsp\n\t" ::: "%rsp");
- __asm__ __volatile__("andq $0xfffffffffffffff0, %%rbp\n\t" ::: "%rbp");
+ __asm__ __volatile__("andq $0xfffffffffffffff0, %rsp\n\t");
+ __asm__ __volatile__("andq $0xfffffffffffffff0, %rbp\n\t");
auto tid = __llvm_libc::syscall_impl(SYS_gettid);
if (tid <= 0)