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: Mike Frysinger
Subject: Re: [Nano-devel] [PATCH 2/3] silence unused shush warning
Date: Sun, 6 Nov 2011 18:13:26 -0500
User-agent: KMail/1.13.7 (Linux/3.1.0-rc4; KDE/4.6.5; x86_64; ; )

On Sunday 06 November 2011 18:06:22 Eitan Adler wrote:
> On Sun, Nov 6, 2011 at 5:46 PM, Mike Frysinger wrote:
> > On Sunday 06 November 2011 16:32:03 Eitan Adler wrote:
> >> On Sun, Nov 6, 2011 at 12:51 PM, Mike Frysinger 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:
> 
> +       (void) chmod(retval, die_stat->st_mode);
> +       (void) chown(retval, die_stat->st_uid, die_stat->st_gid);

this doesn't actually work though.

nano.c: In function ‘die_save_file’:
nano.c:713:2: warning: ignoring return value of ‘chown’, declared with 
attribute warn_unused_result [-Wunused-result]
-mike

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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