erpc
erpc copied to clipboard
[FEATURE] Replace memcpy with macro, own function or better generic function
Is your feature request related to a problem? Please describe.
memcpy has undefined behavior for 0 size and nullptr for data.
Describe the solution you'd like
Describe alternatives you've considered
Steps you didn't forgot to do
- [ ] I checked if there is no related issue opened/closed.
- [ ] I checked that there doesn't exist opened PR which is solving this issue.
Additional context
I don't like the idea of replacing memcpy, as some standard libraries / compilers making lots of optimizations here with special assembly (and that is the reason of the undefined behavior). But wrapper function that calls inside it memcpy is fine by ne.