Messages in this thread |  | | | Date | Tue, 30 Nov 2010 17:24:58 +0800 | | From | Américo Wang <> | | Subject | Re: [PATCH] Repalce strncmp by memcmp |
| |
On Tue, Nov 30, 2010 at 01:49:43AM +0300, Pavel Vasilyev wrote: >On 30.11.2010 01:26, Steven Rostedt wrote: >> On Mon, 2010-11-29 at 17:18 -0500, Steven Rostedt wrote: >> >>> Um, do you realize that the kernel does not always use the same memcmp >>> as gcc. >>> >> Note, I'm not against the change, because in 99% of the cases, memcmp() >> can and will be faster, and we don't need to worry about these strange >> cases. >> >> What I'm against is a blind s/strncmp/memcmp/ of the kernel, because it >> may have side effects that you may not have thought of. >> >Then we have to hang a large banner that is visible to all developers. >"Change wherever possible strncmp to memcmp," :) >
Why? Strings are strings, they are ended by '\0', well-deserved to use str*() functions rather than mem*().
|  |