nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] [PATCH 2/3] silence unused shush warning


From: Eitan Adler
Subject: Re: [Nano-devel] [PATCH 2/3] silence unused shush warning
Date: Sun, 6 Nov 2011 18:06:22 -0500

On Sun, Nov 6, 2011 at 5:46 PM, Mike Frysinger <address@hidden> wrote:
> On Sunday 06 November 2011 16:32:03 Eitan Adler wrote:
>> On Sun, Nov 6, 2011 at 12:51 PM, Mike Frysinger <address@hidden> wrote:
>> > Newer gcc warns about set-but-unused variables, so add a dummy if()
>> > check to kill that off.
>>
>> Please don't do this. It is better to check shush each time for -1.
>
> the code intentionally does this.  the comment explains why.

I forgot about that. IMHO this version makes clearer what is going on:

Index: nano.c
===================================================================
--- nano.c      (revision 4546)
+++ nano.c      (working copy)
@@ -709,9 +709,8 @@
        dont worry if it fails because we're supposed to be bailing as fast
        as possible. */
     if (die_stat) {
-       int shush;
-       shush = chmod(retval, die_stat->st_mode);
-       shush = chown(retval, die_stat->st_uid, die_stat->st_gid);
+       (void) chmod(retval, die_stat->st_mode);
+       (void) chown(retval, die_stat->st_uid, die_stat->st_gid);
     }
 #

> -mike
>



-- 
Eitan Adler



reply via email to

[Prev in Thread] Current Thread [Next in Thread]