Always cast memcpy dest pointers to const void

This commit is contained in:
bal-stan
2025-02-13 18:06:27 +00:00
parent 49435d9f33
commit 2bcc723e10
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ class CMockGeneratorUtils
else
assert_expr = "sizeof(#{arg[:name]}) == sizeof(#{arg[:type]}) ? 1 : -1"
comment = "/* add #{arg[:type]} to :treat_as_array if this causes an error */"
" memcpy((void*)(&#{dest}), (void*)(&#{arg[:name]}),\n" \
" memcpy((void*)(&#{dest}), (const void*)(&#{arg[:name]}),\n" \
" sizeof(#{arg[:type]}[#{assert_expr}])); #{comment}\n"
end
end