Skip to content

Commit 05f4144

Browse files
committed
Remove unsafe memset
1 parent 6c5824a commit 05f4144

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

include/xsimd/config/xsimd_cpuid.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#ifndef XSIMD_CPUID_HPP
1313
#define XSIMD_CPUID_HPP
1414

15-
#include <cstring>
16-
1715
#include "../types/xsimd_all_registers.hpp"
1816
#include "../xsimd_cpu_features_x86.hpp"
1917
#include "xsimd_inline.hpp"
@@ -36,7 +34,7 @@ namespace xsimd
3634
{
3735

3836
#define ARCH_FIELD_EX(arch, field_name) \
39-
unsigned field_name; \
37+
unsigned field_name = 0; \
4038
XSIMD_INLINE bool has(::xsimd::arch) const { return this->field_name; }
4139

4240
#define ARCH_FIELD_EX_REUSE(arch, field_name) \
@@ -86,8 +84,6 @@ namespace xsimd
8684

8785
XSIMD_INLINE supported_arch() noexcept
8886
{
89-
memset(this, 0, sizeof(supported_arch));
90-
9187
#if XSIMD_WITH_WASM
9288
wasm = 1;
9389
#endif

include/xsimd/types/xsimd_common_arch.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#ifndef XSIMD_COMMON_ARCH_HPP
1313
#define XSIMD_COMMON_ARCH_HPP
1414

15+
#include <cstddef>
16+
1517
#include "../config/xsimd_config.hpp"
1618

1719
/**

0 commit comments

Comments
 (0)