On Sun, Jul 5, 2009 at 11:19 AM, Bruno Haible<br...@clisp.org> 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.


Reply via email to