grub-devel
[Top][All Lists]
Advanced

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

Re: warn_unused_result attribute (Re: mingw32 compile fixes (Re: [GITGRU


From: Colin Watson
Subject: Re: warn_unused_result attribute (Re: mingw32 compile fixes (Re: [GITGRUB] New menu interface (implementation)))
Date: Mon, 9 Nov 2009 20:20:54 +0000
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Nov 09, 2009 at 09:04:50PM +0100, Robert Millan wrote:
> On Tue, Nov 10, 2009 at 12:46:06AM +0800, Bean wrote:
> > Some system such as ubuntu karmic define write using
> > warn_unused_result attribute, which cause a warning when return value
> > of write is not used. As grub compile with -Werror, this turn into
> > error, to work around it, use something like this:
> > 
> >  ssize_t tmp = write(bcat, buf, 2048);
> >  (void) tmp;
> 
> Isn't "(void) write (bcat, buf, 2048)" enough?

You'd think so, but sadly that doesn't affect gcc warn_unused_result.
Usually I do something like 'if (write (...) < 0) /* ignore error */;'.

-- 
Colin Watson                                       address@hidden




reply via email to

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