From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#11749: Acknowledgement (24.1; C-mode indentation gives wrong-type-argument error.) Date: Sun, 2 Sep 2012 21:16:20 +0000 Message-ID: <20120902211620.GA3824@acm.acm> References: <87ehpbni8j.fsf@kfs-lx2.home.kfs> <503D4B11.6000501@cua.dk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1346620905 19107 80.91.229.3 (2 Sep 2012 21:21:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 2 Sep 2012 21:21:45 +0000 (UTC) Cc: 11749@debbugs.gnu.org To: Kim Storm Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 02 23:21:46 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T8Hby-0006h9-L8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Sep 2012 23:21:42 +0200 Original-Received: from localhost ([::1]:45816 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8Hbv-0002aS-D8 for geb-bug-gnu-emacs@m.gmane.org; Sun, 02 Sep 2012 17:21:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8Hbs-0002aA-Q8 for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 17:21:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8Hbr-0002ry-Ho for bug-gnu-emacs@gnu.org; Sun, 02 Sep 2012 17:21:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:53621) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8Hbp-0002rJ-Ou; Sun, 02 Sep 2012 17:21:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T8HdG-0007Hw-5i; Sun, 02 Sep 2012 17:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 02 Sep 2012 21:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11749 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 11749-submit@debbugs.gnu.org id=B11749.134662094227949 (code B ref 11749); Sun, 02 Sep 2012 21:23:02 +0000 Original-Received: (at 11749) by debbugs.gnu.org; 2 Sep 2012 21:22:22 +0000 Original-Received: from localhost ([127.0.0.1]:34931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8Hcb-0007Gk-Ub for submit@debbugs.gnu.org; Sun, 02 Sep 2012 17:22:22 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:54887 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T8HcY-0007GY-M4 for 11749@debbugs.gnu.org; Sun, 02 Sep 2012 17:22:20 -0400 Original-Received: (qmail 9532 invoked by uid 3782); 2 Sep 2012 21:20:48 -0000 Original-Received: from acm.muc.de (pD9557A3D.dip.t-dialin.net [217.85.122.61]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 02 Sep 2012 23:20:46 +0200 Original-Received: (qmail 6220 invoked by uid 1000); 2 Sep 2012 21:16:20 -0000 Content-Disposition: inline In-Reply-To: <503D4B11.6000501@cua.dk> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63692 Archived-At: Hello, Kim. On Wed, Aug 29, 2012 at 12:49:53AM +0200, Kim Storm wrote: > M-x report-emacs-bug obviously refuses to include any useful information > -- so I send it through my Thunderbird client... this time. > Tried 24.2 RC2 - and once again I hit this annoying indentation bug i c > mode: > Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p > (5457 . 5720)) > c-guess-basic-syntax() > c-indent-line() > indent-according-to-mode() > c-electric-paren(nil) > call-interactively(c-electric-paren nil nil) > The offsets corresponds to a preceding { ... } block. Yes. It looks like the "state cache" (a cache of certain brace, paren and bracket positions) has got corrupted. This is difficult to make repeatable, and is very dependent upon the exact navigation taken around the C buffer. > The code I was working on is the following (sorry, I cannot show more > than that): > if (!((xdom | xact | xobj | xxtr) & 0x80)) > continue; > if (domains && !alldom && !((xdom | xobj | xxtr) & 0x01)) > { > I get a lot of errors -- making 24.2 impossible to work with for my C code. > Here are some more backtraces: > Debugger entered--Lisp error: (error "Invalid search bound (wrong side > of point)") > re-search-backward("^[ ]*:[ ]*\\(.\\)?" 5920 t) > c-lineup-gcc-asm-reg((arglist-cont-nonempty . 5920)) > c-evaluate-offset(c-lineup-gcc-asm-reg (arglist-cont-nonempty 5920 > 5950) arglist-cont-nonempty) > c-evaluate-offset((c-lineup-gcc-asm-reg c-lineup-arglist) > (arglist-cont-nonempty 5920 5950) arglist-cont-nonempty) > c-calc-offset((arglist-cont-nonempty 5920 5950)) > c-get-syntactic-indentation(((arglist-cont-nonempty 5920 5950))) > c-indent-line() > indent-according-to-mode() > c-electric-paren(nil) > call-interactively(c-electric-paren nil nil) That looks a bit like bug #10941, but isn't it. It could be something quite easy inside `c-lineup-gcc-asm-reg' (which I've not seen being used before). Is this an easily repeatable bug? Any chance of a recipe? Would you also dump your CC Mode configuration (C-c C-b) please. > Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p > (5874 . 5881)) > c-guess-basic-syntax() > c-indent-line() > indent-according-to-mode() > c-electric-paren(nil) > call-interactively(c-electric-paren nil nil) > The last one came when I inserted the final ; in the last line of the > following snippet: > static void add_hash_ext(idhash_t **hp, id_t *idtab, int n) > { > } > static idhash_t *lookup_ext(idhash_t **hp, ); I've not been able to reproduce it in that limited context. It looks like another bug in the state cache, and they're bastards. > Yes, there are syntax errors in that code -- but indentation should be > able to > handle that without signalling errors all the time. Yes. > I have seen similar problems in 24.1 - but not in 23.4 that I usually > use (for this very reason). Might you have something unusual in your CC Mode config? -- Alan Mackenzie (Nuremberg, Germany).