[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Type-error in C code
From: |
Stefan Monnier |
Subject: |
Type-error in C code |
Date: |
Fri, 12 Nov 2010 09:02:10 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
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
- Type-error in C code,
Stefan Monnier <=
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, Jan Djärv, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, Eli Zaretskii, 2010/11/12
- Re: Type-error in C code, Julien Danjou, 2010/11/12
- Re: Type-error in C code, John Yates, 2010/11/12
- Re: Type-error in C code, Eli Zaretskii, 2010/11/12
- Re: Type-error in C code, Andreas Schwab, 2010/11/12