lib: rpmsg_rpc: fix compilation warning and bad API #587
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix following warning by updating bad rpc_id parameter type in the rpmsg_rpc_client_send() API.
Align the rpc_id type to the one used in rpmsg_rpc_server_send().
/github/workspace/lib/service/rpmsg/rpc/rpmsg_rpc_client.c:60:9: error: ‘memcpy’ reading 8 bytes from a region of size 4 [-Werror=stringop-overread]
1286
60 | memcpy(tmpbuf, &rpc_id, MAX_FUNC_ID_LEN);
1287
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1288
/github/workspace/lib/service/rpmsg/rpc/rpmsg_rpc_client.c:51:40: note: source object ‘rpc_id’ of size 4
1289
51 | unsigned int rpc_id, void *request_param,
1290
| ~~~~~~~~~~~~~^~~~~~