httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@gbiv.com>
Subject Re: [PATCH] How to Use strcmp to Check for Equality Without Confusing Your Fellow Code, Or: Isn't There a Macro for That?
Date Tue, 19 Oct 2010 19:21:12 GMT
On Oct 19, 2010, at 9:36 AM, Malte S. Stretz wrote:
> And there are a lot of string compares in the Apache codebase.  Everytime 
> you see a strcmp, you (or is it only me?) have to stop and think "well, is 
> this branch checking for equality or the opposite?"
> 
> I think this is a case where either a coding standard could help, or some 
> helper macros in APR.  I went for the latter and defined APR_EQ plus 
> variants in apr_string.h.  See attached patch.

Maybe a standard would help.  More macros would not -- that pain would be
far worse than the current inconsistency.  -1 (design opinion, not veto)

....Roy


Mime
View raw message