aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android-changes-for-ndk-developers.md2
-rwxr-xr-xbenchmarks/linker_relocation/regen/gen_bench.py4
-rw-r--r--benchmarks/pthread_benchmark.cpp7
-rw-r--r--benchmarks/semaphore_benchmark.cpp113
-rw-r--r--libc/arch-x86/bionic/__libc_init_sysinfo.cpp4
-rw-r--r--libc/bionic/getauxval.cpp8
-rw-r--r--libc/bionic/libc_init_common.cpp16
-rw-r--r--libc/bionic/pthread_attr.cpp3
-rw-r--r--libc/bionic/pthread_create.cpp2
-rw-r--r--libc/bionic/sysinfo.cpp5
-rw-r--r--libc/include/nl_types.h2
-rw-r--r--libc/private/bionic_auxv.h2
-rw-r--r--libc/stdio/local.h2
-rw-r--r--libc/stdio/stdio.cpp4
-rw-r--r--linker/linker.cpp2
-rw-r--r--linker/linker_block_allocator_test.cpp10
-rw-r--r--tests/bionic_allocator_test.cpp8
-rw-r--r--tests/dlext_test.cpp2
-rw-r--r--tests/ftw_test.cpp14
-rw-r--r--tests/libs/dlopen_b.cpp7
-rw-r--r--tests/libs/elftls_dynamic.cpp4
-rw-r--r--tests/link_test.cpp2
-rw-r--r--tests/stdatomic_test.cpp4
-rw-r--r--tools/versioner/src/DeclarationDatabase.cpp4
-rw-r--r--tools/versioner/src/Preprocessor.cpp6
-rw-r--r--tools/versioner/src/versioner.cpp8
-rw-r--r--tools/versioner/tests/multiple_decl_mismatch/expected_fail2
-rw-r--r--tools/versioner/tests/multiple_definition/expected_fail2
-rw-r--r--tools/versioner/tests/version_mismatch/expected_fail2
29 files changed, 67 insertions, 184 deletions
diff --git a/android-changes-for-ndk-developers.md b/android-changes-for-ndk-developers.md
index a0f3c3c50..b8f2f5925 100644
--- a/android-changes-for-ndk-developers.md
+++ b/android-changes-for-ndk-developers.md
@@ -218,7 +218,7 @@ from known vulnerabilities.
Each ELF file has additional information contained in the section
headers. These headers must be present now, because the dynamic linker
-uses them for sanity checking. Some developers strip them in an
+uses them for validity checking. Some developers strip them in an
attempt to obfuscate the binary and prevent reverse engineering. (This
doesn't really help because it is possible to reconstruct the stripped
information using widely-available tools.)
diff --git a/benchmarks/linker_relocation/regen/gen_bench.py b/benchmarks/linker_relocation/regen/gen_bench.py
index 74823198d..09efa75f9 100755
--- a/benchmarks/linker_relocation/regen/gen_bench.py
+++ b/benchmarks/linker_relocation/regen/gen_bench.py
@@ -137,7 +137,7 @@ def build_symbol_index(lib: LoadedLibrary) -> Definitions:
return defs
-def sanity_check_rels(root: LoadedLibrary, defs: Definitions) -> None:
+def check_rels(root: LoadedLibrary, defs: Definitions) -> None:
# Find every symbol for every relocation in the load group.
has_missing = False
for lib in bfs_walk(root):
@@ -389,7 +389,7 @@ def main() -> None:
with open(Path(args.input)) as f:
root = json_to_elf_tree(json.load(f))
defs = build_symbol_index(root)
- sanity_check_rels(root, defs)
+ check_rels(root, defs)
if out.exists(): shutil.rmtree(out)
os.makedirs(str(out))
diff --git a/benchmarks/pthread_benchmark.cpp b/benchmarks/pthread_benchmark.cpp
index 9a68a12d0..856f1502e 100644
--- a/benchmarks/pthread_benchmark.cpp
+++ b/benchmarks/pthread_benchmark.cpp
@@ -53,15 +53,14 @@ static void BM_pthread_setspecific(benchmark::State& state) {
}
BIONIC_BENCHMARK(BM_pthread_setspecific);
-static void DummyPthreadOnceInitFunction() {
-}
+static void NoOpPthreadOnceInitFunction() {}
static void BM_pthread_once(benchmark::State& state) {
static pthread_once_t once = PTHREAD_ONCE_INIT;
- pthread_once(&once, DummyPthreadOnceInitFunction);
+ pthread_once(&once, NoOpPthreadOnceInitFunction);
while (state.KeepRunning()) {
- pthread_once(&once, DummyPthreadOnceInitFunction);
+ pthread_once(&once, NoOpPthreadOnceInitFunction);
}
}
BIONIC_BENCHMARK(BM_pthread_once);
diff --git a/benchmarks/semaphore_benchmark.cpp b/benchmarks/semaphore_benchmark.cpp
index cf5148983..ffccc82d7 100644
--- a/benchmarks/semaphore_benchmark.cpp
+++ b/benchmarks/semaphore_benchmark.cpp
@@ -28,8 +28,8 @@ static void BM_semaphore_sem_getvalue(benchmark::State& state) {
sem_init(&semaphore, 1, 1);
while (state.KeepRunning()) {
- int dummy;
- sem_getvalue(&semaphore, &dummy);
+ int unused;
+ sem_getvalue(&semaphore, &unused);
}
}
BIONIC_BENCHMARK(BM_semaphore_sem_getvalue);
@@ -44,112 +44,3 @@ static void BM_semaphore_sem_wait_sem_post(benchmark::State& state) {
}
}
BIONIC_BENCHMARK(BM_semaphore_sem_wait_sem_post);
-
-// This test reports the overhead of the underlying futex wake syscall on
-// the producer. It does not report the overhead from issuing the wake to the
-// point where the posted consumer thread wakes up. It suffers from
-// clock_gettime syscall overhead. Lock the CPU speed for consistent results
-// as we may not reach >50% cpu utilization.
-//
-// We will run a background thread that catches the sem_post wakeup and
-// loops immediately returning back to sleep in sem_wait for the next one. This
-// thread is run with policy SCHED_OTHER (normal policy), a middle policy.
-//
-// The primary thread will run at SCHED_IDLE (lowest priority policy) when
-// monitoring the background thread to detect when it hits sem_wait sleep. It
-// will do so with no clock running. Once we are ready, we will switch to
-// SCHED_FIFO (highest priority policy) to time the act of running sem_post
-// with the benchmark clock running. This ensures nothing else in the system
-// can preempt our timed activity, including the background thread. We are
-// also protected with the scheduling policy of letting a process hit a
-// resource limit rather than get hit with a context switch.
-//
-// The background thread will start executing either on another CPU, or
-// after we back down from SCHED_FIFO, but certainly not in the context of
-// the timing of the sem_post.
-
-static atomic_int BM_semaphore_sem_post_running;
-
-static void* BM_semaphore_sem_post_start_thread(void* arg) {
- sem_t* semaphore = reinterpret_cast<sem_t*>(arg);
- while ((BM_semaphore_sem_post_running > 0) && !sem_wait(semaphore)) {
- }
- BM_semaphore_sem_post_running = -1;
- return nullptr;
-}
-
-class SemaphoreFixture : public benchmark::Fixture {
- public:
- void SetUp(const benchmark::State&) override {
- sem_init(&semaphore, 0, 0);
-
- pthread_attr_t attr;
- pthread_attr_init(&attr);
-
- memset(&param, 0, sizeof(param));
- pthread_attr_setschedparam(&attr, &param);
- pthread_attr_setschedpolicy(&attr, SCHED_OTHER);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- pthread_t pthread;
- pthread_create(&pthread, &attr, BM_semaphore_sem_post_start_thread, &semaphore);
- pthread_attr_destroy(&attr);
-
- sched_setscheduler(0, SCHED_IDLE, &param);
-
- BM_semaphore_sem_post_running = 1;
- setup = true;
- }
-
- ~SemaphoreFixture() override {
- if (setup) {
- // Only do this if the test was actually run.
- sched_setscheduler(0, SCHED_OTHER, &param);
-
- if (BM_semaphore_sem_post_running > 0) {
- BM_semaphore_sem_post_running = 0;
- }
- do {
- sem_post(&semaphore);
- sched_yield();
- } while (BM_semaphore_sem_post_running != -1);
- }
- }
-
- sem_t semaphore;
- sched_param param;
- bool setup = false;
-};
-
-// This is commented out because dynamic benchmark registering doesn't currently support fixtures.
-// Uncomment it and recompile to run this benchmark on every run.
-/* BENCHMARK_F(SemaphoreFixture, semaphore_sem_post)(benchmark::State& state) {
- while (state.KeepRunning()) {
- state.PauseTiming();
-
- int trys = 3, dummy = 0;
- do {
- if (BM_semaphore_sem_post_running < 0) {
- sched_setscheduler(0, SCHED_OTHER, &param);
- fprintf(stderr, "BM_semaphore_sem_post: start_thread died unexpectedly\n");
- abort();
- }
- sched_yield();
- sem_getvalue(&semaphore, &dummy);
- if (dummy < 0) { // POSIX.1-2001 possibility 1
- break;
- }
- if (dummy == 0) { // POSIX.1-2001 possibility 2
- --trys;
- }
- } while (trys);
-
- param.sched_priority = 1;
- sched_setscheduler(0, SCHED_FIFO, &param);
-
- state.ResumeTiming();
- sem_post(&semaphore);
-
- param.sched_priority = 0;
- sched_setscheduler(0, SCHED_IDLE, &param);
- }
-}*/
diff --git a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
index 5c44b4ea4..db931d140 100644
--- a/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
+++ b/libc/arch-x86/bionic/__libc_init_sysinfo.cpp
@@ -37,8 +37,8 @@ __LIBC_HIDDEN__ __attribute__((__naked__)) void __libc_int0x80() {
}
__LIBC_HIDDEN__ void __libc_init_sysinfo() {
- bool dummy;
- __libc_sysinfo = reinterpret_cast<void*>(__bionic_getauxval(AT_SYSINFO, dummy));
+ bool unused;
+ __libc_sysinfo = reinterpret_cast<void*>(__bionic_getauxval(AT_SYSINFO, &unused));
}
// TODO: lose this function and just access __libc_sysinfo directly.
diff --git a/libc/bionic/getauxval.cpp b/libc/bionic/getauxval.cpp
index d6f75f83a..a3c6b1932 100644
--- a/libc/bionic/getauxval.cpp
+++ b/libc/bionic/getauxval.cpp
@@ -37,20 +37,20 @@
// This function needs to be safe to call before TLS is set up, so it can't
// access errno or the stack protector.
-__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool& exists) {
+__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists) {
for (ElfW(auxv_t)* v = __libc_shared_globals()->auxv; v->a_type != AT_NULL; ++v) {
if (v->a_type == type) {
- exists = true;
+ *exists = true;
return v->a_un.a_val;
}
}
- exists = false;
+ *exists = false;
return 0;
}
extern "C" unsigned long getauxval(unsigned long type) {
bool exists;
- unsigned long result = __bionic_getauxval(type, exists);
+ unsigned long result = __bionic_getauxval(type, &exists);
if (!exists) errno = ENOENT;
return result;
}
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 1ede969cf..f1350d5f9 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -359,10 +359,8 @@ void __libc_fini(void* array) {
Dtor* fini_array = reinterpret_cast<Dtor*>(array);
const Dtor minus1 = reinterpret_cast<Dtor>(static_cast<uintptr_t>(-1));
- // Sanity check - first entry must be -1.
- if (array == nullptr || fini_array[0] != minus1) {
- return;
- }
+ // Validity check: the first entry must be -1.
+ if (array == nullptr || fini_array[0] != minus1) return;
// Skip over it.
fini_array += 1;
@@ -373,15 +371,9 @@ void __libc_fini(void* array) {
++count;
}
- // Now call each destructor in reverse order.
+ // Now call each destructor in reverse order, ignoring any -1s.
while (count > 0) {
Dtor dtor = fini_array[--count];
-
- // Sanity check, any -1 in the list is ignored.
- if (dtor == minus1) {
- continue;
- }
-
- dtor();
+ if (dtor != minus1) dtor();
}
}
diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp
index 1551c1ff9..89aa28966 100644
--- a/libc/bionic/pthread_attr.cpp
+++ b/libc/bionic/pthread_attr.cpp
@@ -192,7 +192,8 @@ static int __pthread_attr_getstack_main_thread(void** stack_base, size_t* stack_
return errno;
}
- // If the current RLIMIT_STACK is RLIM_INFINITY, only admit to an 8MiB stack for sanity's sake.
+ // If the current RLIMIT_STACK is RLIM_INFINITY, only admit to an 8MiB stack
+ // in case callers such as ART take infinity too literally.
if (stack_limit.rlim_cur == RLIM_INFINITY) {
stack_limit.rlim_cur = 8 * 1024 * 1024;
}
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp
index d4a8bef26..c52810574 100644
--- a/libc/bionic/pthread_create.cpp
+++ b/libc/bionic/pthread_create.cpp
@@ -350,7 +350,7 @@ static int __pthread_start(void* arg) {
return 0;
}
-// A dummy start routine for pthread_create failures where we've created a thread but aren't
+// A no-op start routine for pthread_create failures where we've created a thread but aren't
// going to run user code on it. We swap out the user's start routine for this and take advantage
// of the regular thread teardown to free up resources.
static void* __do_nothing(void*) {
diff --git a/libc/bionic/sysinfo.cpp b/libc/bionic/sysinfo.cpp
index 1d1070e2b..7ab8e9eda 100644
--- a/libc/bionic/sysinfo.cpp
+++ b/libc/bionic/sysinfo.cpp
@@ -38,9 +38,10 @@
static bool __matches_cpuN(const char* s) {
// The %c trick is to ensure that we have the anchored match "^cpu[0-9]+$".
+ // We can't use %*c because the return value is how many were *assigned*.
unsigned cpu;
- char dummy;
- return (sscanf(s, "cpu%u%c", &cpu, &dummy) == 1);
+ char unused;
+ return (sscanf(s, "cpu%u%c", &cpu, &unused) == 1);
}
int get_nprocs_conf() {
diff --git a/libc/include/nl_types.h b/libc/include/nl_types.h
index 622880ac9..1c80e4e4c 100644
--- a/libc/include/nl_types.h
+++ b/libc/include/nl_types.h
@@ -32,7 +32,7 @@
* @file nl_types.h
* @brief Message catalogs.
*
- * Android offers a dummy implementation of these functions to ease porting of historical software.
+ * Android offers a no-op implementation of these functions to ease porting of historical software.
*/
#include <sys/cdefs.h>
diff --git a/libc/private/bionic_auxv.h b/libc/private/bionic_auxv.h
index 8e33c1cf1..9d2cfdd4f 100644
--- a/libc/private/bionic_auxv.h
+++ b/libc/private/bionic_auxv.h
@@ -30,4 +30,4 @@
#include <sys/cdefs.h>
-__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool& exists);
+__LIBC_HIDDEN__ unsigned long __bionic_getauxval(unsigned long type, bool* exists);
diff --git a/libc/stdio/local.h b/libc/stdio/local.h
index 1ecf1220f..12f3bf54e 100644
--- a/libc/stdio/local.h
+++ b/libc/stdio/local.h
@@ -259,7 +259,7 @@ extern void __sinit(void); // Not actually implemented.
size_t parsefloat(FILE*, char*, char*);
size_t wparsefloat(FILE*, wchar_t*, wchar_t*);
-// Sanity check a FILE* for nullptr, so we can emit a message while crashing
+// Check a FILE* isn't nullptr, so we can emit a message while crashing
// instead of doing a blind null-dereference.
#define CHECK_FP(fp) \
if (fp == nullptr) __fortify_fatal("%s: null FILE*", __FUNCTION__)
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index a0b421923..afc2c4881 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -1026,9 +1026,9 @@ int vsnprintf(char* s, size_t n, const char* fmt, va_list ap) {
__check_count("vsnprintf", "size", n);
// Stdio internals do not deal correctly with zero length buffer.
- char dummy;
+ char one_byte_buffer[1];
if (n == 0) {
- s = &dummy;
+ s = one_byte_buffer;
n = 1;
}
diff --git a/linker/linker.cpp b/linker/linker.cpp
index a41ca091b..7cfe87be7 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -3168,7 +3168,7 @@ bool soinfo::prelink_image() {
DEBUG("si->base = %p, si->strtab = %p, si->symtab = %p",
reinterpret_cast<void*>(base), strtab_, symtab_);
- // Sanity checks.
+ // Validity checks.
if (relocating_linker && needed_count != 0) {
DL_ERR("linker cannot have DT_NEEDED dependencies on other libraries");
return false;
diff --git a/linker/linker_block_allocator_test.cpp b/linker/linker_block_allocator_test.cpp
index 359eefbab..6fb2b2680 100644
--- a/linker/linker_block_allocator_test.cpp
+++ b/linker/linker_block_allocator_test.cpp
@@ -47,14 +47,14 @@ struct test_struct_nominal {
* this one has size below allocator cap which is 2*sizeof(void*)
*/
struct test_struct_small {
- char dummy_str[5];
+ char str[5];
};
/*
* 1009 byte struct (1009 is prime)
*/
struct test_struct_larger {
- char dummy_str[1009];
+ char str[1009];
};
static size_t kPageSize = sysconf(_SC_PAGE_SIZE);
@@ -131,14 +131,14 @@ static void protect_all() {
allocator.protect_all(PROT_READ);
allocator.protect_all(PROT_READ | PROT_WRITE);
// check access
- page2_ptr->dummy_str[23] = 27;
- page1_ptr->dummy_str[13] = 11;
+ page2_ptr->str[23] = 27;
+ page1_ptr->str[13] = 11;
allocator.protect_all(PROT_READ);
fprintf(stderr, "trying to access protected page");
// this should result in segmentation fault
- page1_ptr->dummy_str[11] = 7;
+ page1_ptr->str[11] = 7;
}
TEST(linker_allocator, test_protect) {
diff --git a/tests/bionic_allocator_test.cpp b/tests/bionic_allocator_test.cpp
index f71090704..fdcf86827 100644
--- a/tests/bionic_allocator_test.cpp
+++ b/tests/bionic_allocator_test.cpp
@@ -42,19 +42,19 @@ namespace {
* this one has size below allocator cap which is 2*sizeof(void*)
*/
struct test_struct_small {
- char dummy_str[5];
+ char str[5];
};
struct test_struct_large {
- char dummy_str[1009];
+ char str[1009];
};
struct test_struct_huge {
- char dummy_str[73939];
+ char str[73939];
};
struct test_struct_512 {
- char dummy_str[503];
+ char str[503];
};
};
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index 1139e53ca..4c4a1c3e8 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -2022,7 +2022,7 @@ TEST(dlext, ns_anonymous) {
}
}
- // some sanity checks..
+ // Some validity checks.
ASSERT_TRUE(addr_start > 0);
ASSERT_TRUE(addr_end > 0);
ASSERT_TRUE(maps_to_copy.size() > 0);
diff --git a/tests/ftw_test.cpp b/tests/ftw_test.cpp
index dfc4d723f..200ed4b61 100644
--- a/tests/ftw_test.cpp
+++ b/tests/ftw_test.cpp
@@ -49,7 +49,7 @@ static void MakeTree(const char* root) {
ASSERT_EQ(0, close(fd));
}
-void sanity_check_ftw(const char* fpath, const struct stat* sb, int tflag) {
+void smoke_test_ftw(const char* fpath, const struct stat* sb, int tflag) {
ASSERT_TRUE(fpath != nullptr);
ASSERT_TRUE(sb != nullptr);
@@ -75,28 +75,28 @@ void sanity_check_ftw(const char* fpath, const struct stat* sb, int tflag) {
}
}
-void sanity_check_nftw(const char* fpath, const struct stat* sb, int tflag, FTW* ftwbuf) {
- sanity_check_ftw(fpath, sb, tflag);
+void smoke_test_nftw(const char* fpath, const struct stat* sb, int tflag, FTW* ftwbuf) {
+ smoke_test_ftw(fpath, sb, tflag);
ASSERT_EQ('/', fpath[ftwbuf->base - 1]) << fpath;
}
int check_ftw(const char* fpath, const struct stat* sb, int tflag) {
- sanity_check_ftw(fpath, sb, tflag);
+ smoke_test_ftw(fpath, sb, tflag);
return 0;
}
int check_ftw64(const char* fpath, const struct stat64* sb, int tflag) {
- sanity_check_ftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag);
+ smoke_test_ftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag);
return 0;
}
int check_nftw(const char* fpath, const struct stat* sb, int tflag, FTW* ftwbuf) {
- sanity_check_nftw(fpath, sb, tflag, ftwbuf);
+ smoke_test_nftw(fpath, sb, tflag, ftwbuf);
return 0;
}
int check_nftw64(const char* fpath, const struct stat64* sb, int tflag, FTW* ftwbuf) {
- sanity_check_nftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag, ftwbuf);
+ smoke_test_nftw(fpath, reinterpret_cast<const struct stat*>(sb), tflag, ftwbuf);
return 0;
}
diff --git a/tests/libs/dlopen_b.cpp b/tests/libs/dlopen_b.cpp
index cd81e16c1..092c96c95 100644
--- a/tests/libs/dlopen_b.cpp
+++ b/tests/libs/dlopen_b.cpp
@@ -1,15 +1,14 @@
#include <dlfcn.h>
extern "C" void *dlopen_b() {
- // TODO (dimitry): this is to work around http://b/20049306
- // remove once it is fixed
- static int dummy = 0;
+ // Work around for http://b/20049306, which isn't going to be fixed.
+ static int defeat_sibling_call_optimization = 0;
// This is supposed to succeed because this library has DT_RUNPATH
// for libtest_dt_runpath_x.so which should be taken into account
// by dlopen.
void *handle = dlopen("libtest_dt_runpath_x.so", RTLD_NOW);
if (handle != nullptr) {
- dummy++;
+ defeat_sibling_call_optimization++;
return handle;
}
return nullptr;
diff --git a/tests/libs/elftls_dynamic.cpp b/tests/libs/elftls_dynamic.cpp
index 6da2f6f40..25004848c 100644
--- a/tests/libs/elftls_dynamic.cpp
+++ b/tests/libs/elftls_dynamic.cpp
@@ -41,8 +41,8 @@ extern "C" char* get_large_tls_var_addr() {
// section, but does not have an entry in the dynsym table and whose
// solib-relative address appears to overlap with the large TLS variable.
extern "C" void* get_local_addr() {
- static char dummy[1024];
- return &dummy[512];
+ static char buf[1024];
+ return &buf[512];
}
// This variable comes from libtest_elftls_shared_var.so, which is part of
diff --git a/tests/link_test.cpp b/tests/link_test.cpp
index 75bb4d618..127a3d989 100644
--- a/tests/link_test.cpp
+++ b/tests/link_test.cpp
@@ -258,7 +258,7 @@ TEST(link, dl_unwind_find_exidx) {
ASSERT_TRUE(entries != nullptr);
ASSERT_GT(count, 0);
- // Sanity checks
+ // Validity checks.
uintptr_t func = reinterpret_cast<uintptr_t>(read_exidx_func);
bool found = false;
for (int i = 0; i < count; ++i) {
diff --git a/tests/stdatomic_test.cpp b/tests/stdatomic_test.cpp
index 11d41b4a4..7b98df24b 100644
--- a/tests/stdatomic_test.cpp
+++ b/tests/stdatomic_test.cpp
@@ -192,7 +192,7 @@ struct three_atomics {
atomic_uint_least32_t z;
};
-// Very simple acquire/release memory ordering sanity check.
+// Very simple acquire/release memory ordering smoke test.
static void* writer(void* arg) {
three_atomics* a = reinterpret_cast<three_atomics*>(arg);
for (uint_least32_t i = 0; i <= BIG; i+=2) {
@@ -239,7 +239,7 @@ static void* reader(void* arg) {
}
TEST(stdatomic, ordering) {
- // Run a memory ordering sanity test.
+ // Run a memory ordering smoke test.
void* result;
three_atomics a;
atomic_init(&a.x, 0ul);
diff --git a/tools/versioner/src/DeclarationDatabase.cpp b/tools/versioner/src/DeclarationDatabase.cpp
index b41c8655e..ec2e38dbe 100644
--- a/tools/versioner/src/DeclarationDatabase.cpp
+++ b/tools/versioner/src/DeclarationDatabase.cpp
@@ -190,8 +190,8 @@ class Visitor : public RecursiveASTVisitor<Visitor> {
auto symbol_it = database.symbols.find(declaration_name);
if (symbol_it == database.symbols.end()) {
Symbol symbol = {.name = declaration_name };
- bool dummy;
- std::tie(symbol_it, dummy) = database.symbols.insert({ declaration_name, symbol });
+ bool unused;
+ std::tie(symbol_it, unused) = database.symbols.insert({declaration_name, symbol});
}
auto expansion_range = src_manager.getExpansionRange(range);
diff --git a/tools/versioner/src/Preprocessor.cpp b/tools/versioner/src/Preprocessor.cpp
index 7a5b502db..eb88c4669 100644
--- a/tools/versioner/src/Preprocessor.cpp
+++ b/tools/versioner/src/Preprocessor.cpp
@@ -237,7 +237,7 @@ static std::string generateGuardCondition(const DeclarationAvailability& avail)
return "("s + Join(expressions, ") || (") + ")";
}
-// Assumes that nothing crazy is happening (e.g. having the semicolon be in a macro)
+// Assumes that nothing weird is happening (e.g. having the semicolon be in a macro).
static FileLocation findNextSemicolon(const std::deque<std::string>& lines, FileLocation start) {
unsigned current_line = start.line;
unsigned current_column = start.column;
@@ -373,8 +373,8 @@ static void mergeGuards(std::deque<std::string>& file_lines, GuardMap& guard_map
guard_map.erase(current);
guard_map.erase(next);
- bool dummy;
- std::tie(current, dummy) = guard_map.insert(std::make_pair(merged, avail));
+ bool unused;
+ std::tie(current, unused) = guard_map.insert(std::make_pair(merged, avail));
next = current;
++next;
}
diff --git a/tools/versioner/src/versioner.cpp b/tools/versioner/src/versioner.cpp
index 99228dd27..c818197a0 100644
--- a/tools/versioner/src/versioner.cpp
+++ b/tools/versioner/src/versioner.cpp
@@ -276,7 +276,7 @@ static std::vector<T> Intersection(const std::set<T>& a, const std::set<T>& b) {
return intersection;
}
-// Perform a sanity check on a symbol's declarations, enforcing the following invariants:
+// Perform a validity check on a symbol's declarations, enforcing the following invariants:
// 1. At most one inline definition of the function exists (overloaded inline functions for
// _FORTIFY_SOURCE do not count because they are usually introduced to intercept the original
// functions or usually have enable_if attributes).
@@ -334,7 +334,7 @@ static bool checkSymbol(const Symbol& symbol) {
return true;
}
-static bool sanityCheck(const HeaderDatabase* database) {
+static bool validityCheck(const HeaderDatabase* database) {
bool error = false;
std::string cwd = getWorkingDir() + "/";
@@ -676,8 +676,8 @@ int main(int argc, char** argv) {
if (dump) {
declaration_database->dump(location.header_path + "/");
} else {
- if (!sanityCheck(declaration_database.get())) {
- printf("versioner: sanity check failed\n");
+ if (!validityCheck(declaration_database.get())) {
+ printf("versioner: validity check failed\n");
failed = true;
}
diff --git a/tools/versioner/tests/multiple_decl_mismatch/expected_fail b/tools/versioner/tests/multiple_decl_mismatch/expected_fail
index 1d1f266c5..30e72336e 100644
--- a/tools/versioner/tests/multiple_decl_mismatch/expected_fail
+++ b/tools/versioner/tests/multiple_decl_mismatch/expected_fail
@@ -5,4 +5,4 @@ versioner: failed to calculate symbol availability
obsoleted = 12
extern declaration @ headers/foo.h:5:1
obsoleted = 9
-versioner: sanity check failed
+versioner: validity check failed
diff --git a/tools/versioner/tests/multiple_definition/expected_fail b/tools/versioner/tests/multiple_definition/expected_fail
index cb4acc643..5abb833d8 100644
--- a/tools/versioner/tests/multiple_definition/expected_fail
+++ b/tools/versioner/tests/multiple_definition/expected_fail
@@ -4,4 +4,4 @@ versioner: conflicting inline definitions for symbol foo:
no availability
static definition @ headers/bar.h:5:1
no availability
-versioner: sanity check failed
+versioner: validity check failed
diff --git a/tools/versioner/tests/version_mismatch/expected_fail b/tools/versioner/tests/version_mismatch/expected_fail
index f2143a394..95d284b31 100644
--- a/tools/versioner/tests/version_mismatch/expected_fail
+++ b/tools/versioner/tests/version_mismatch/expected_fail
@@ -5,4 +5,4 @@ versioner: failed to calculate symbol availability
introduced = 9
extern declaration @ headers/foo.h:8:1
introduced = 10
-versioner: sanity check failed
+versioner: validity check failed