Messages in this thread | | | From | Ian Campbell <> | Date | Mon, 30 Jul 2012 15:26:13 +0100 | Subject | Re: [PATCH] ACPI: replace strlen("string") with sizeof("string") -1 |
| |
On Thu, 2012-07-26 at 21:39 -0400, Len Brown wrote: > ...both give the number of chars in the string > without the '\0', as strncmp() wants, > but sizeof() is compile-time.
I thought gcc optimised strlen("string literal") into a compile time constant too. It does in a little userspace test I just wrote, but I didn't look at its behaviour with the kernel's strlen.
Ian.
| |