> Von: Jan Kiszka > Gesendet: Freitag, 8. November 2013 19:18 > > On 2013-11-08 18:23, Gilles Chanteperdrix wrote: > > On 11/08/2013 06:55 AM, Gernot Hillier wrote: > >> Am 07.11.2013 19:01, schrieb Gilles Chanteperdrix: > >>> On 11/07/2013 10:22 AM, Gernot Hillier wrote: > >>>> Some glibc versions mark write() with attribute warn_unused_result > >>>> (found in > >>>> Ubuntu 12.04 / eglibc 2.15 / gcc 4.6.3), so we need to silence this > >>>> warning, > >>>> especially when building with -Werror. > >>> > >>> Why not casting write result to void, it does not work? > >>> > >> > >> No, it doesn't. For rationale, please see > >> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509. > >> > > ... > > > > I believe you still can do: > > > > rc = write > > (void)rc > > Yep, that's what other projects do as well when there is really no use > for the return code. > > > > > The link you sent also indicates that the warning can be disabled with > > -Wno-unused-result > > > > Can you not compile with this option on distributions with this behaviour? > > Let's fix this in our source code, not in the ./configure command line. > I expect the warning to become more frequent with recent compilers > and/or distros.
Since this has been recognized as a bug http://sourceware.org/bugzilla/show_bug.cgi?id=11959 in glibc and fixed, it should become less frequent with recent distros. I think, source code shouldn't be cluttered with silly workarounds. -- Best regards, Dietmar Schindler ________________________________________ manroland web systems GmbH -- Managing Director: Eckhard Hoerner-Marass Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No. 26816 -- VAT: DE281389840 Confidentiality note: This eMail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you are not the intended recipient, you are hereby notified that any use or dissemination of this communication is strictly prohibited. If you have received this eMail in error, then please delete this eMail. ! Please consider your environmental responsibility before printing this eMail ________________________________________ _______________________________________________ Xenomai mailing list [email protected] http://www.xenomai.org/mailman/listinfo/xenomai
