diff mbox

Another warning fix in adaint.c

Message ID 20160117175125.GO3017@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Jan. 17, 2016, 5:51 p.m. UTC
Hi!

Following patch fixes another warning in adaint.c:
../../gcc/ada/adaint.c: In function 'void __gnat_killprocesstree(int, int)':
../../gcc/ada/adaint.c:3284:26: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   while (d = readdir (dir))
                          ^

Bootstrapped/regtested on x86_64-linux, ok for trunk?

2016-01-17  Jakub Jelinek  <jakub@redhat.com>

	* adaint.c (__gnat_killprocesstree): Avoid -Wparentheses warning.



	Jakub

Comments

Arnaud Charlet Jan. 17, 2016, 5:56 p.m. UTC | #1
> Following patch fixes another warning in adaint.c:
> ../../gcc/ada/adaint.c: In function 'void
> __gnat_killprocesstree(int, int)':
> ../../gcc/ada/adaint.c:3284:26: warning: suggest parentheses around
> assignment used as truth value [-Wparentheses]
>    while (d = readdir (dir))
>                           ^
> 
> Bootstrapped/regtested on x86_64-linux, ok for trunk?

Yes, thanks.

> 2016-01-17  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* adaint.c (__gnat_killprocesstree): Avoid -Wparentheses warning.
diff mbox

Patch

--- gcc/ada/adaint.c.jj	2016-01-15 21:15:09.000000000 +0100
+++ gcc/ada/adaint.c	2016-01-16 10:32:44.133293832 +0100
@@ -3281,7 +3281,7 @@  void __gnat_killprocesstree (int pid, in
 
   /* kill child processes first */
 
-  while (d = readdir (dir))
+  while ((d = readdir (dir)) != NULL)
     {
       if ((d->d_type & DT_DIR) == DT_DIR)
         {