From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: attribute warn_unused_result Date: Fri, 04 Feb 2011 10:29:07 +0200 Message-ID: <83hbckb3u4.fsf@gnu.org> References: <83r5bobz2k.fsf@gnu.org> <4D4B4EEA.50907@cs.ucla.edu> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1296809180 7324 80.91.229.12 (4 Feb 2011 08:46:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 Feb 2011 08:46:20 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 04 09:46:16 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PlHJ2-0000Gv-4O for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2011 09:46:16 +0100 Original-Received: from localhost ([127.0.0.1]:51137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlHJ1-0002NY-I0 for ged-emacs-devel@m.gmane.org; Fri, 04 Feb 2011 03:46:15 -0500 Original-Received: from [140.186.70.92] (port=34016 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlHDx-0007wx-G4 for emacs-devel@gnu.org; Fri, 04 Feb 2011 03:41:02 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlH2O-0005Fb-Vm for emacs-devel@gnu.org; Fri, 04 Feb 2011 03:29:05 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:43182) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlH2O-0005FD-PD for emacs-devel@gnu.org; Fri, 04 Feb 2011 03:29:04 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0LG3008003JAYW00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Fri, 04 Feb 2011 10:29:03 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.124.97.124]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LG3008GK3KBX250@a-mtaout23.012.net.il>; Fri, 04 Feb 2011 10:29:03 +0200 (IST) In-reply-to: <4D4B4EEA.50907@cs.ucla.edu> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.175 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:135562 Archived-At: > Date: Thu, 03 Feb 2011 16:57:14 -0800 > From: Paul Eggert > CC: Stefan Monnier , emacs-devel@gnu.org > > On 02/03/11 13:14, Eli Zaretskii wrote: > >> From: Stefan Monnier > > >> I think the right thing to do is to adjust the code so as to make it > >> clear to the compiler that we thought about the issue and decided that > >> we really do want to ignore the return value. > > > > You can't do that, not with this warning. > > Actually, you can do it. In the current trunk, the warning is > ignored for one particular case, documented by wrapping the > call in question by ignore_value (CALL). This is in > src/sysdep.c, line 583. I know, but that's not what I meant, and I imagine that's not what Stefan meant, either. It is a truism that you can avoid the warning by adding a call to another function that is not declared with the warn_unused_result attribute. What I meant was that it seems to be impossible to tell the compiler not to emit this warning by the "usual" C technique of using a cast. Btw, isn't it ironic that gnulib, a GNU project, and all other GNU projects that use gnulib, need to jump through the hoops to work around misfeatures in glibc, one of the most important and core GNU projects?