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

Re: Is it OK to have compile warnings






On Tue, Oct 22, 2013 at 8:41 PM, Tong Sun <mlist4suntong@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-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] 1382492499.68644.YahooMailNeo@web161904.mail.bf1.yahoo.com" target="_blank">http://lists.debian.org/[🔎] 1382492499.68644.YahooMailNeo@web161904.mail.bf1.yahoo.com



Reply to: