Fix warning in misc/tst-mntent2.c.

Message ID 1418678844.7165.9.camel@triegel.csb
State Committed
Headers

Commit Message

Torvald Riegel Dec. 15, 2014, 9:27 p.m. UTC
  This fixes a -Werror failure with a recent GCC build by adding
parentheses.  OK?

2014-12-15  Torvald Riegel  <triegel@redhat.com>

	* misc/tst-mntent2.c (do_test): Fix warning.
  

Comments

Ondrej Bilka Dec. 15, 2014, 10:45 p.m. UTC | #1
On Mon, Dec 15, 2014 at 10:27:24PM +0100, Torvald Riegel wrote:
> This fixes a -Werror failure with a recent GCC build by adding
> parentheses.  OK?
>
ok 
> 2014-12-15  Torvald Riegel  <triegel@redhat.com>
> 
> 	* misc/tst-mntent2.c (do_test): Fix warning.
> 

> commit 8df1db0d06065f114b15345430c2bb8c90c01bf7
> Author: Torvald Riegel <triegel@redhat.com>
> Date:   Mon Dec 15 22:11:56 2014 +0100
> 
>     Fix warning in misc/tst-mntent2.c.
> 
> diff --git a/misc/tst-mntent2.c b/misc/tst-mntent2.c
> index e61d506..ba1ee0a 100644
> --- a/misc/tst-mntent2.c
> +++ b/misc/tst-mntent2.c
> @@ -17,7 +17,7 @@ do_test (void)
>    mef.mnt_passno = 2;
>  
>  #define TEST(opt, found) \
> -  if (!!hasmntopt (&mef, (opt)) != (found))				\
> +  if ((!!hasmntopt (&mef, (opt))) != (found))				\
>      {									\
>        printf ("Option %s was %sfound\n", (opt), (found) ? "not " : "");	\
>        result = 1;							\
  

Patch

commit 8df1db0d06065f114b15345430c2bb8c90c01bf7
Author: Torvald Riegel <triegel@redhat.com>
Date:   Mon Dec 15 22:11:56 2014 +0100

    Fix warning in misc/tst-mntent2.c.

diff --git a/misc/tst-mntent2.c b/misc/tst-mntent2.c
index e61d506..ba1ee0a 100644
--- a/misc/tst-mntent2.c
+++ b/misc/tst-mntent2.c
@@ -17,7 +17,7 @@  do_test (void)
   mef.mnt_passno = 2;
 
 #define TEST(opt, found) \
-  if (!!hasmntopt (&mef, (opt)) != (found))				\
+  if ((!!hasmntopt (&mef, (opt))) != (found))				\
     {									\
       printf ("Option %s was %sfound\n", (opt), (found) ? "not " : "");	\
       result = 1;							\