Skip to content

Commit 91e33ea

Browse files
committed
Silence GCC 8's warning about using realloc/memmove on non-POD
1 parent 6cd6d31 commit 91e33ea

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util/small_map.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class small_mapt
146146
if(n == 0)
147147
return nullptr;
148148

149-
T *mem = (T *)realloc(ptr, sizeof(T) * n);
149+
T *mem = (T *)realloc((char *)ptr, sizeof(T) * n);
150150

151151
if(!mem)
152152
throw std::bad_alloc();
@@ -486,7 +486,7 @@ class small_mapt
486486
std::size_t n = size();
487487
if(ii < n - 1)
488488
{
489-
memmove(p + ii, p + ii + 1, sizeof(T) * (n - ii - 1));
489+
memmove((char *)(p + ii), p + ii + 1, sizeof(T) * (n - ii - 1));
490490
}
491491

492492
p = allocate(p, n - 1);

0 commit comments

Comments
 (0)