[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] argv-iter: new module
From: |
James Youngman |
Subject: |
Re: [PATCH] argv-iter: new module |
Date: |
Sun, 5 Jul 2009 12:35:44 +0100 |
On Sun, Jul 5, 2009 at 11:19 AM, Bruno Haible<address@hidden> wrote:
> About the unit test:
>
>> +#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
>
> What is the reason for the extra parentheses? Is some gcc warning avoided
> by this?
Well, that technique does protect you against bugs resulting from
various odd usages, such as "STREQ(a,b) < 1". Without the parens, you
get the same effect as "strcmp (a, b) == 1".
James.