From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Julien Danjou Newsgroups: gmane.emacs.devel Subject: Re: Type-error in C code Date: Fri, 12 Nov 2010 15:21:06 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1289571684 10947 80.91.229.12 (12 Nov 2010 14:21:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 12 Nov 2010 14:21:24 +0000 (UTC) Cc: Jan =?utf-8?Q?Dj=C3=A4rv?= , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 12 15:21:20 2010 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 1PGuVC-0003nh-F5 for ged-emacs-devel@m.gmane.org; Fri, 12 Nov 2010 15:21:18 +0100 Original-Received: from localhost ([127.0.0.1]:36379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGuVB-0000mI-To for ged-emacs-devel@m.gmane.org; Fri, 12 Nov 2010 09:21:17 -0500 Original-Received: from [140.186.70.92] (port=53441 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGuV5-0000kI-Tn for emacs-devel@gnu.org; Fri, 12 Nov 2010 09:21:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGuV4-0008Jr-D5 for emacs-devel@gnu.org; Fri, 12 Nov 2010 09:21:11 -0500 Original-Received: from coquelicot-s.easter-eggs.com ([213.215.37.94]:42243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGuV3-0008Iz-Cn for emacs-devel@gnu.org; Fri, 12 Nov 2010 09:21:10 -0500 Original-Received: from cigue.easter-eggs.fr (cigue.easter-eggs.fr [10.0.0.33]) by rose.easter-eggs.fr (Postfix) with ESMTPS id 65AA4140D2; Fri, 12 Nov 2010 15:21:03 +0100 (CET) Original-Received: from jdanjou by cigue.easter-eggs.fr with local (Exim 4.72) (envelope-from ) id 1PGuV0-00067Q-4G; Fri, 12 Nov 2010 15:21:06 +0100 Mail-Followup-To: Stefan Monnier , Jan =?utf-8?Q?Dj=C3=A4rv?= , emacs-devel@gnu.org In-Reply-To: (Stefan Monnier's message of "Fri, 12 Nov 2010 09:02:10 -0500") User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:132569 Archived-At: On Fri, Nov 12 2010, Stefan Monnier wrote: > static void > set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value) > { > struct x_display_info *dpyinfo =3D FRAME_X_DISPLAY_INFO (XFRAME (frame)= ); > > x_send_client_event (frame, make_number (0), frame, > dpyinfo->Xatom_net_wm_state, > make_number (32), > /* 1 =3D add, 0 =3D remove */ > Fcons > (make_number (add ? 1 : 0), > Fcons > (atom, > value !=3D 0 ? value : Qnil))); > } > > The error is to put an "Atom" into a cons cell: those can only hold > Lisp_Objects. The usual compilation flags won't catch the error because > both types are actually some kind of integer, but if you > compile --enable-use-lisp-union-type, the C compiler will > dutyfully burp. Good catch Stefan. I should use this flag to compile my code now. The fix should be easy I think, you just need to replace atom with make_number (atom). I can provide a patch is that handier. --=20 Julien Danjou // =E1=90=B0 http://julien.danjou.info