unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Type-error in C code
@ 2010-11-12 14:02 Stefan Monnier
  2010-11-12 14:21 ` Julien Danjou
  2010-11-12 18:45 ` Andreas Schwab
  0 siblings, 2 replies; 35+ messages in thread
From: Stefan Monnier @ 2010-11-12 14:02 UTC (permalink / raw)
  To: Julien Danjou; +Cc: Jan Djärv, emacs-devel

The following code installed by the recent atom-change has a type-error:

static void
set_wm_state (Lisp_Object frame, int add, Atom atom, Atom value)
{
  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (frame));

  x_send_client_event (frame, make_number (0), frame,
                       dpyinfo->Xatom_net_wm_state,
                       make_number (32),
                       /* 1 = add, 0 = remove */
                       Fcons
                       (make_number (add ? 1 : 0),
                        Fcons
                        (atom,
                         value != 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.


        Stefan



^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2010-11-16 17:05 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-12 14:02 Type-error in C code Stefan Monnier
2010-11-12 14:21 ` Julien Danjou
2010-11-12 15:12   ` Jan Djärv
2010-11-12 15:22     ` Julien Danjou
2010-11-12 15:28       ` Julien Danjou
2010-11-12 15:32         ` Julien Danjou
2010-11-12 15:48           ` Eli Zaretskii
2010-11-12 15:58             ` Julien Danjou
2010-11-12 16:06               ` John Yates
2010-11-12 16:20                 ` Eli Zaretskii
2010-11-12 16:47                   ` Andreas Schwab
2010-11-12 19:44                 ` Miles Bader
2010-11-12 15:48       ` Eli Zaretskii
2010-11-12 17:13       ` Jan D.
2010-11-12 21:15     ` Thien-Thi Nguyen
2010-11-13 19:19       ` Jan Djärv
2010-11-13 19:52         ` Thien-Thi Nguyen
2010-11-13 22:23           ` Jan Djärv
2010-11-13 20:38         ` Johan Bockgård
2010-11-14 10:21           ` Jan Djärv
2010-11-12 18:45 ` Andreas Schwab
2010-11-12 21:00   ` Stefan Monnier
2010-11-15 21:11     ` Julien Danjou
2010-11-15 21:19     ` Andreas Schwab
2010-11-16  5:43       ` Stefan Monnier
2010-11-16  7:56         ` Julien Danjou
2010-11-16  9:05           ` Stephen J. Turnbull
2010-11-16  9:28             ` Julien Danjou
2010-11-16 12:11               ` Stephen J. Turnbull
2010-11-16 15:14           ` Stefan Monnier
2010-11-16 15:38             ` Julien Danjou
2010-11-16 17:05               ` Stefan Monnier
2010-11-16  9:36         ` Andreas Schwab
2010-11-13 20:00   ` Julien Danjou
2010-11-15 16:08     ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).