Skip to content

Commit 211bbe4

Browse files
committed
clang-tidy: check and fix cppcoreguidelines-avoid-c-arrays
1 parent 7099d52 commit 211bbe4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/common/assert.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3636
#endif
3737

3838
#include <string>
39+
#include <array>
3940
#include <exception>
4041

4142

4243
std::string get_backtrace() {
4344
#ifdef __GLIBC__
44-
void *trace[16];
45+
std::array<void*, 16> trace;
4546
int i = 0, trace_size = 0;
4647

47-
trace_size = backtrace(trace, 16);
48-
char** funcNames = backtrace_symbols(trace, trace_size);
48+
trace_size = backtrace(trace.data(), 16);
49+
char** funcNames = backtrace_symbols(trace.data(), trace_size);
4950

5051

5152
std::string message = "\n*** Execution path***\n";

0 commit comments

Comments
 (0)