|
From: | Paul Eggert |
Subject: | Re: [bug-grep] search.c clean-up |
Date: | Tue, 23 Nov 2004 09:09:16 -0800 |
User-agent: | Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Jim Meyering <address@hidden> writes: >> Note that some compiling environments might optimise away strlen >> calls on constant strings, but only if they know at compile time >> that they are going to be linked to a "strlen" that behaves like >> the standard version of that function. That's a dangerous >> assumption in some environments. The use of intermediate variables >> can much more easily be optimised away. > > I see no problem with using strlen here. I agree. The C Standard does not allow user programs to redefine strlen. This is true even for programs that don't include <string.h>. It's quite safe in practice to assume that strlen has the usual behavior.
[Prev in Thread] | Current Thread | [Next in Thread] |