mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-08-03 01:37:51 +00:00
Suppress warning when returning thru const or volatile ptr
GCC gives a warning: warning: passing argument 1 of 'memcpy' discards 'const volatile' qualifier from pointer target type and the same for argument 2. These additional casts suppress the warning.
This commit is contained in:
@@ -65,7 +65,7 @@ class CMockGeneratorPluginReturnThruPtr
|
||||
lines << " if (cmock_call_instance->ReturnThruPtr_#{arg_name}_Used)\n"
|
||||
lines << " {\n"
|
||||
lines << " UNITY_TEST_ASSERT_NOT_NULL(#{arg_name}, cmock_line, CMockStringPtrIsNULL);\n"
|
||||
lines << " memcpy(#{arg_name}, cmock_call_instance->ReturnThruPtr_#{arg_name}_Val,\n"
|
||||
lines << " memcpy((void*)#{arg_name}, (void*)cmock_call_instance->ReturnThruPtr_#{arg_name}_Val,\n"
|
||||
lines << " cmock_call_instance->ReturnThruPtr_#{arg_name}_Size);\n"
|
||||
lines << " }\n"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user