From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Schwab Subject: Re: [PATCH] ACPI: replace strlen("string") with sizeof("string") -1 Date: Mon, 06 Aug 2012 12:26:58 +0200 Message-ID: References: <5011F15A.3060007@kernel.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from mail-out.m-online.net ([212.18.0.10]:56213 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751316Ab2HFK1K (ORCPT ); Mon, 6 Aug 2012 06:27:10 -0400 In-Reply-To: <5011F15A.3060007@kernel.org> (Len Brown's message of "Thu, 26 Jul 2012 21:39:38 -0400") Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: Len Brown Cc: Alan Stern , linux-acpi@vger.kernel.org, linux-pm@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Len Brown , Pavel Vasilyev Len Brown writes: > ...both give the number of chars in the string > without the '\0', as strncmp() wants, > but sizeof() is compile-time. Does this actually change anything? The compiler is able to expand strlen at compile time if the argument is a constant, provided that that builtin strlen isn't disabled. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."