On Tue, Oct 22, 2013 at 8:41 PM, Tong Sun <mlist4sunt...@yahoo.com> wrote:
> Hi, > > Is it OK to have compile warnings when building a package? If not, > > how can I fix the following: > > dial.c: In function 'main': > dial.c:273:8: warning: ignoring return value of 'write', declared with > attribute warn_unused_result [-Wunused-result] > write(fd, buf, bufidx); > > To directly answer your question, since I think everyone so far has told you that you should fix it, this answer from S/O [1] #define ignore_result(x) ({ typeof(x) z = x; (void)sizeof z; }) then: ignore_result( func(...) ) [1] http://stackoverflow.com/questions/3614691/casting-to-void-doesnt-remove-warn-unused-result-error/3615000#3615000 I got a bunch of such ignoring-return-value warnings. > > Thanks > > > > -- > To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org > with a subject of "unsubscribe". Trouble? Contact > listmas...@lists.debian.org > Archive: > http://lists.debian.org/1382492499.68644.yahoomail...@web161904.mail.bf1.yahoo.com > >