Clang 18.1 with lto gained the ability to eliminate dead stores. Since debug::the_database is write-only as far as the compiler understands (it is read only by gdb), all writes to it are eliminated. Protect writes to the variable by marking it volatile. Closes scylladb/scylladb#22454
16 lines
237 B
C++
16 lines
237 B
C++
/*
|
|
* Copyright (C) 2023-present ScyllaDB
|
|
*/
|
|
|
|
/*
|
|
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0
|
|
*/
|
|
|
|
#include "debug.hh"
|
|
|
|
namespace debug {
|
|
|
|
seastar::sharded<replica::database>* volatile the_database = nullptr;
|
|
|
|
}
|