sys/util: Stricter bytecpy impl
The docstring for this function states that it is guaranteed to perform a copy byte by byte, but this is not true in general without a `volatile` storage type on the casted pointer. Signed-off-by: Chris McDonald <cjmcdonald@chromium.org>
This commit is contained in:
parent
6adda40775
commit
f882d43b56
1 changed files with 1 additions and 1 deletions
|
@ -253,7 +253,7 @@ static inline void bytecpy(void *dst, const void *src, size_t size)
|
|||
size_t i;
|
||||
|
||||
for (i = 0; i < size; ++i) {
|
||||
((uint8_t *)dst)[i] = ((const uint8_t *)src)[i];
|
||||
((volatile uint8_t *)dst)[i] = ((volatile const uint8_t *)src)[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue