erpc icon indicating copy to clipboard operation
erpc copied to clipboard

[FEATURE] Replace memcpy with macro, own function or better generic function

Open Hadatko opened this issue 2 years ago • 1 comments

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

Hadatko avatar Mar 07 '23 12:03 Hadatko

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.

amgross avatar Mar 08 '23 07:03 amgross