From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.bugs Subject: bug#4643: two different definitions for catchlist in eval.c and alloc.c Date: Tue, 13 Oct 2009 23:38:24 -0700 (PDT) Message-ID: <200910140638.n9E6cOJi019664@godzilla.ics.uci.edu> References: <200910051618.n95GIX0i012545@godzilla.ics.uci.edu> <200910070832.n978W0Zi003116@godzilla.ics.uci.edu> Reply-To: Dan Nicolaescu , 4643@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1255502864 9990 80.91.229.12 (14 Oct 2009 06:47:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Oct 2009 06:47:44 +0000 (UTC) To: 4643@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 14 08:47:34 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mxxdz-0005zM-Fn for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Oct 2009 08:47:31 +0200 Original-Received: from localhost ([127.0.0.1]:42876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxxdy-0007Y4-Nh for geb-bug-gnu-emacs@m.gmane.org; Wed, 14 Oct 2009 02:47:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mxxdt-0007Vb-Is for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2009 02:47:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mxxdp-0007QL-TQ for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2009 02:47:25 -0400 Original-Received: from [199.232.76.173] (port=43167 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mxxdp-0007QD-JE for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2009 02:47:21 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]:3295) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mxxdo-0004HB-TE for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2009 02:47:21 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mxxdn-0006Uh-MN for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2009 02:47:20 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9E6lAS1006928; Tue, 13 Oct 2009 23:47:11 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n9E6j4nl006419; Tue, 13 Oct 2009 23:45:04 -0700 Resent-Date: Tue, 13 Oct 2009 23:45:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Dan Nicolaescu Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 14 Oct 2009 06:45:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 4643 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 4643-submit@emacsbugs.donarmstrong.com id=B4643.12555023165547 (code B ref 4643); Wed, 14 Oct 2009 06:45:04 +0000 Original-Received: (at 4643) by emacsbugs.donarmstrong.com; 14 Oct 2009 06:38:36 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from paul-mcgann-v0.ics.uci.edu (paul-mcgann-v0.ics.uci.edu [128.195.1.147]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9E6cZQs005544 for <4643@emacsbugs.donarmstrong.com>; Tue, 13 Oct 2009 23:38:36 -0700 Original-Received: from godzilla.ics.uci.edu (godzilla.ics.uci.edu [128.195.10.101]) by paul-mcgann-v0.ics.uci.edu (8.13.8/8.13.8) with ESMTP id n9E6cOLn000639 for <4643@emacsbugs.donarmstrong.com>; Tue, 13 Oct 2009 23:38:24 -0700 Original-Received: (from dann@localhost) by godzilla.ics.uci.edu (8.13.8+Sun/8.13.6/Submit) id n9E6cOJi019664; Tue, 13 Oct 2009 23:38:24 -0700 (PDT) In-Reply-To: <200910070832.n978W0Zi003116@godzilla.ics.uci.edu> (Dan Nicolaescu's message of "Wed, 7 Oct 2009 01:32:00 -0700 (PDT)") Original-Lines: 182 X-ICS-MailScanner-Information: Please send mail to helpdesk@ics.uci.edu or more information X-ICS-MailScanner-ID: n9E6cOLn000639 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-1.363, required 5, autolearn=disabled, ALL_TRUSTED -1.44, TW_GC 0.08) X-ICS-MailScanner-From: dann@godzilla.ics.uci.edu X-detected-operating-system: by mx20.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Resent-Date: Wed, 14 Oct 2009 02:47:25 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:31912 Archived-At: Dan Nicolaescu writes: > Here's a patch that fixes this problem by moving the definition in a > separate file included in both places. > > OK to check in? Ping. Without a change like this emacs cannot be compiled using gcc-4.5 -flto > Index: src/Makefile.in > =================================================================== > RCS file: /cvsroot/emacs/emacs/src/Makefile.in,v > retrieving revision 1.450 > diff -u -3 -p -r1.450 Makefile.in > --- src/Makefile.in 26 Sep 2009 19:49:17 -0000 1.450 > +++ src/Makefile.in 7 Oct 2009 08:26:06 -0000 > @@ -1231,14 +1231,14 @@ xsmfns.o: xsmfns.c $(config_h) systime.h > /* The files of Lisp proper */ > > alloc.o: alloc.c process.h frame.h window.h buffer.h puresize.h syssignal.h keyboard.h \ > - blockinput.h atimer.h systime.h character.h dispextern.h $(config_h) \ > + blockinput.h atimer.h systime.h character.h dispextern.h catchtag.h $(config_h) \ > $(INTERVALS_H) > bytecode.o: bytecode.c buffer.h syntax.h character.h window.h dispextern.h \ > frame.h xterm.h $(config_h) > data.o: data.c buffer.h puresize.h character.h syssignal.h keyboard.h frame.h \ > termhooks.h $(config_h) > eval.o: eval.c commands.h keyboard.h blockinput.h atimer.h systime.h \ > - dispextern.h $(config_h) > + dispextern.h catchtag.h $(config_h) > floatfns.o: floatfns.c syssignal.h $(config_h) > fns.o: fns.c commands.h $(config_h) frame.h buffer.h character.h keyboard.h \ > keymap.h frame.h window.h dispextern.h $(INTERVALS_H) coding.h md5.h \ > Index: src/alloc.c > =================================================================== > RCS file: /cvsroot/emacs/emacs/src/alloc.c,v > retrieving revision 1.449 > diff -u -3 -p -r1.449 alloc.c > --- src/alloc.c 25 Aug 2009 06:03:09 -0000 1.449 > +++ src/alloc.c 7 Oct 2009 08:26:08 -0000 > @@ -56,6 +56,7 @@ along with GNU Emacs. If not, see #include "syssignal.h" > #include "termhooks.h" /* For struct terminal. */ > #include > +#include "catchtag.h" > > /* GC_MALLOC_CHECK defined means perform validity checks of malloc'd > memory. Can do this only if using gmalloc.c. */ > @@ -4939,13 +4940,6 @@ staticpro (varaddress) > abort (); > } > > -struct catchtag > -{ > - Lisp_Object tag; > - Lisp_Object val; > - struct catchtag *next; > -}; > - > > /*********************************************************************** > Protection from GC > Index: src/eval.c > =================================================================== > RCS file: /cvsroot/emacs/emacs/src/eval.c,v > retrieving revision 1.315 > diff -u -3 -p -r1.315 eval.c > --- src/eval.c 1 Oct 2009 17:47:44 -0000 1.315 > +++ src/eval.c 7 Oct 2009 08:26:08 -0000 > @@ -26,6 +26,7 @@ along with GNU Emacs. If not, see #include "keyboard.h" > #include "dispextern.h" > #include > +#include "catchtag.h" > > #if HAVE_X_WINDOWS > #include "xterm.h" > @@ -49,41 +50,6 @@ struct backtrace > > struct backtrace *backtrace_list; > > -/* This structure helps implement the `catch' and `throw' control > - structure. A struct catchtag contains all the information needed > - to restore the state of the interpreter after a non-local jump. > - > - Handlers for error conditions (represented by `struct handler' > - structures) just point to a catch tag to do the cleanup required > - for their jumps. > - > - catchtag structures are chained together in the C calling stack; > - the `next' member points to the next outer catchtag. > - > - A call like (throw TAG VAL) searches for a catchtag whose `tag' > - member is TAG, and then unbinds to it. The `val' member is used to > - hold VAL while the stack is unwound; `val' is returned as the value > - of the catch form. > - > - All the other members are concerned with restoring the interpreter > - state. */ > - > -struct catchtag > -{ > - Lisp_Object tag; > - Lisp_Object val; > - struct catchtag *next; > - struct gcpro *gcpro; > - jmp_buf jmp; > - struct backtrace *backlist; > - struct handler *handlerlist; > - int lisp_eval_depth; > - int pdlcount; > - int poll_suppress_count; > - int interrupt_input_blocked; > - struct byte_stack *byte_stack; > -}; > - > struct catchtag *catchlist; > > #ifdef DEBUG_GCPRO > --- /dev/null 2009-08-21 19:23:04.524086726 -0700 > +++ src/catchtag.h 2009-10-07 01:11:39.784950000 -0700 > @@ -0,0 +1,57 @@ > +/* Structure for implementing the `catch' and `throw' control structure. > + Copyright (C) 2009 Free Software Foundation, Inc. > + > +This file is part of GNU Emacs. > + > +GNU Emacs is free software: you can redistribute it and/or modify > +it under the terms of the GNU General Public License as published by > +the Free Software Foundation, either version 3 of the License, or > +(at your option) any later version. > + > +GNU Emacs is distributed in the hope that it will be useful, > +but WITHOUT ANY WARRANTY; without even the implied warranty of > +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +GNU General Public License for more details. > + > +You should have received a copy of the GNU General Public License > +along with GNU Emacs. If not, see . */ > + > +#ifndef CATCHTAG_H > +#define CATCHTAG_H > + > +/* This structure helps implement the `catch' and `throw' control > + structure. A struct catchtag contains all the information needed > + to restore the state of the interpreter after a non-local jump. > + > + Handlers for error conditions (represented by `struct handler' > + structures) just point to a catch tag to do the cleanup required > + for their jumps. > + > + catchtag structures are chained together in the C calling stack; > + the `next' member points to the next outer catchtag. > + > + A call like (throw TAG VAL) searches for a catchtag whose `tag' > + member is TAG, and then unbinds to it. The `val' member is used to > + hold VAL while the stack is unwound; `val' is returned as the value > + of the catch form. > + > + All the other members are concerned with restoring the interpreter > + state. */ > + > +struct catchtag > +{ > + Lisp_Object tag; > + Lisp_Object val; > + struct catchtag *next; > + struct gcpro *gcpro; > + jmp_buf jmp; > + struct backtrace *backlist; > + struct handler *handlerlist; > + int lisp_eval_depth; > + int pdlcount; > + int poll_suppress_count; > + int interrupt_input_blocked; > + struct byte_stack *byte_stack; > +}; > + > +#endif /* CATCHTAG_H */