From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: warning compiling dbusbind.c Date: Thu, 24 Jan 2008 16:25:22 -0500 Message-ID: References: <5btzl3f2xh.fsf@fencepost.gnu.org> <87prvr7zvt.fsf@gmx.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1201209955 25106 80.91.229.12 (24 Jan 2008 21:25:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Jan 2008 21:25:55 +0000 (UTC) Cc: Glenn Morris , emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 24 22:26:14 2008 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.50) id 1JI9aH-0004zc-5c for ged-emacs-devel@m.gmane.org; Thu, 24 Jan 2008 22:26:05 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JI9Zr-0005WU-0O for ged-emacs-devel@m.gmane.org; Thu, 24 Jan 2008 16:25:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JI9Zm-0005VU-Vg for emacs-devel@gnu.org; Thu, 24 Jan 2008 16:25:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JI9Zk-0005TS-Bk for emacs-devel@gnu.org; Thu, 24 Jan 2008 16:25:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JI9Zk-0005T2-5B for emacs-devel@gnu.org; Thu, 24 Jan 2008 16:25:32 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JI9Zf-0004xn-PK; Thu, 24 Jan 2008 16:25:27 -0500 Original-Received: from ceviche.home (x-132-204-254-59.xtpr.umontreal.ca [132.204.254.59]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with SMTP id m0OLPSNi026359; Thu, 24 Jan 2008 16:25:30 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id 5A566B409A; Thu, 24 Jan 2008 16:25:22 -0500 (EST) In-Reply-To: <87prvr7zvt.fsf@gmx.de> (Michael Albinus's message of "Thu, 24 Jan 2008 21:05:42 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-NAI-Spam-Score: -1.2 X-NAI-Spam-Rules: 2 Rules triggered BAYES_01=-1.2, HAS_X_HELO=0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) 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:87452 Archived-At: > I've used make_fixnum_or_float, because BITS_PER_EMACS_INT is too small > on 32bit machines. One possible solution could be > dbus_uint32_t val; > dbus_message_iter_get_basic (iter, &val); > XD_DEBUG_MESSAGE ("%c %d", dtype, val); > #if BITS_PER_EMACS_INT >= 32 > return make_number (val); > #else > return make_fixnum_or_float (val); > #endif Yuck. I must prefer living with the warning (which is just that: a warning. We already have several similar ones). > On the other hand, shouldn't it be handled in make_fixnum_or_float? No, because make_fixnum_or_float expects an integer of type EMACS_INT. The problem here is that you pass it an object that is slight smaller, so soome of its internal code cann be optimized away, which is what the compiler warns you about. Maybe casting val to EMACS_INT is enough to silence the compiler? I wonder if gcc would also complain in the case where make_fixnum_or_float is an inlinable function. I'd guess not. Stefan