simple question about the function memcmp in kernel

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Sun Apr 7 21:33:37 EDT 2013


On Mon, 08 Apr 2013 08:57:01 +0800, Ben Wu said:

> int memcmp(const void *cs, const void *ct, size_t count)
> {

> I want to know why it use the temp pointer su1, su2? why it doesn't directly
> use the cs and ct pointer?

This is a C 101 question, not a kernel question.  But anyhow..

They're declared const, so the compiler will whine about ++'ing them.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130407/3d8cef9a/attachment.bin 


More information about the Kernelnewbies mailing list