Re: [cocci] [RFC] Increasing usage of direct pointer assignments from memcpy() calls with SmPL?

From: Markus Elfring

Date: Fri Oct 31 2025 - 02:01:20 EST


> No one will thank you for making these changes... :( Please don't do it.

I am curious if further developers would dare to try another source code search pattern out.

@display@
expression destination, size, source, target;
@@
*target = memcpy(destination, source, size);


I would like to point out that return values from memcpy() calls are assigned
to variables in 16 source files of the software “Linux next-20251030”.

Under which circumstances can development interests grow to reduce “unused”
return values also for this kind of function?
https://wiki.sei.cmu.edu/confluence/display/c/MSC13-C.+Detect+and+remove+unused+values

Regards,
Markus