Re: [PATCH] ACPI: replace strlen("string") with sizeof("string") -1

From: richard -rw- weinberger
Date: Mon Jul 30 2012 - 10:41:52 EST


On Mon, Jul 30, 2012 at 4:26 PM, Ian Campbell <ijc@xxxxxxxxxxxxxx> wrote:
> 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.

It depends whether you use the built-in strlen() or not.
AFAIK the kernel does not use the built-in variant.

--
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/