From unknown Tue Jun 17 01:50:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15728: 24.3.50; cc-mode incorrectly parses particular macro Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2013 04:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15728 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 15728@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.138284740211060 (code B ref -1); Sun, 27 Oct 2013 04:17:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Oct 2013 04:16:42 +0000 Received: from localhost ([127.0.0.1]:46850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaHmM-0002sJ-0M for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41658) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaHmJ-0002s4-QK for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaHm8-0000gX-0p for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHm7-0000gT-U0 for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHm2-0007HC-4U for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:16:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaHlw-0000f1-Ba for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:16:22 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:47471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHlw-0000et-3o for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:16:16 -0400 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 2377520D4F for ; Sun, 27 Oct 2013 00:16:14 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sun, 27 Oct 2013 00:16:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=Z7fbobtAivs48a+fbJjgapa7XNw=; b=qQqaqdhF3HVdVcFjbwh0R V8QLt51pwvuIciLk1BXl3U63m1PkdqaKYviLnauwNzAMwGWOXCW6nFJNmfHFWBGF K0gya0RLqSANuA1wPQ2vf6whzr8RrEsvzY7RYccszakjHjsJEw21DzJ6UCXSq4vt yzMmK1m/4DINebGgoZAhSI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=Z7fbobtAivs48a+fbJjgap a7XNw=; b=UHBNHQF5ICFNvLWjzH/gICAd6fNUYScoA8w2zZLuIBPvrR3wqqWz7c YSZBXwZhkaX9uo3ki+RvcLsRhYd1MZU+olFk6CmIPUQgQDCSa5h67FICzNv2ve9j B6kJiSeJVdU/i4pWsVEcTVKb831I6idmAS7pMxi+OIaLZ0lrL2pZk= X-Sasl-enc: Ljgcclho2m+sD2ztZYFUd56eXc6kee1gK+n4cdDNC5Tz 1382847373 Received: from shorty.local (unknown [76.169.247.77]) by mail.messagingengine.com (Postfix) with ESMTPA id D14916800CB for ; Sun, 27 Oct 2013 00:16:13 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.80) (envelope-from ) id 1VaHls-0002IW-H7 for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 21:16:12 -0700 From: Dima Kogan Date: Sat, 26 Oct 2013 21:16:12 -0700 Message-ID: <87d2mr1h83.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I have the following source file: ========================================================================= int f(void) { #define A(b) \ int abc ## b; \ g() } ========================================================================= This indentation is what the latest emacs thinks is correct. Note that the g() line is indented ahead of the 'int abc' line. This is wrong; they should have the same indentation. Indeed this is what happens with emacs23. In the latest emacs the syntax parser thinks the g() line is 'statement-cont', instead of 'statement'; this is directly related to the issue. Furthermore, the 'abc ## b' construct is what's confusing the parser. Removing the '##' makes it parse correctly again. I'm observing this issue with all emacs24 builds I've tried, with 'emacs -Q'. From unknown Tue Jun 17 01:50:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15728: bug #15728: 24.3.50; cc-mode incorrectly parses particular macro References: <87d2mr1h83.fsf@secretsauce.net> In-Reply-To: <87d2mr1h83.fsf@secretsauce.net> Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2013 13:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15728 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 15728@debbugs.gnu.org Cc: Dima Kogan Received: via spool by 15728-submit@debbugs.gnu.org id=B15728.13828818895502 (code B ref 15728); Sun, 27 Oct 2013 13:52:02 +0000 Received: (at 15728) by debbugs.gnu.org; 27 Oct 2013 13:51:29 +0000 Received: from localhost ([127.0.0.1]:47433 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaQka-0001Qg-G8 for submit@debbugs.gnu.org; Sun, 27 Oct 2013 09:51:28 -0400 Received: from colin.muc.de ([193.149.48.1]:36653 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaQkY-0001QX-Iw for 15728@debbugs.gnu.org; Sun, 27 Oct 2013 09:51:27 -0400 Received: (qmail 87320 invoked by uid 3782); 27 Oct 2013 13:51:24 -0000 Received: from acm.muc.de (pD9518626.dip0.t-ipconnect.de [217.81.134.38]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 27 Oct 2013 14:51:23 +0100 Received: (qmail 4498 invoked by uid 1000); 27 Oct 2013 13:49:15 -0000 Date: Sun, 27 Oct 2013 13:49:15 +0000 Message-ID: <20131027134914.GA4412@acm.acm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.2 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) Hello, Dima Dima Kogan writes: > I have the following source file: > ========================================================================= > int f(void) > { > #define A(b) \ > int abc ## b; \ > g() > } > ========================================================================= > This indentation is what the latest emacs thinks is correct. Note that > the g() line is indented ahead of the 'int abc' line. This is wrong; > they should have the same indentation. Indeed this is what happens with > emacs23. > In the latest emacs the syntax parser thinks the g() line is > 'statement-cont', instead of 'statement'; this is directly related to > the issue. Furthermore, the 'abc ## b' construct is what's confusing the > parser. Removing the '##' makes it parse correctly again. Funnily enough, it seems to work OK if the macro isn't written inside a function. > I'm observing this issue with all emacs24 builds I've tried, with 'emacs > -Q'. Thanks for the bug report, and thanks even more for making it crisp and concise. I think the following patch should fix it. Would you try it out, please, and let me know how well it works. diff -r c21bf2a4a8b8 cc-engine.el --- a/cc-engine.el Sun Oct 20 14:10:45 2013 +0000 +++ b/cc-engine.el Sun Oct 27 13:31:43 2013 +0000 @@ -1266,12 +1266,15 @@ ;; looking for more : and ?. (setq c-maybe-labelp nil skip-chars (substring c-stmt-delim-chars 0 -2))) - ;; At a CPP construct? - ((and c-opt-cpp-symbol (looking-at c-opt-cpp-symbol) - (save-excursion - (forward-line 0) - (looking-at c-opt-cpp-prefix))) - (c-end-of-macro)) + ;; At a CPP construct or a "#" or "##" operator? + ((and c-opt-cpp-symbol (looking-at c-opt-cpp-symbol)) + (if (save-excursion + (skip-chars-backward " \t") + (and (bolp) + (or (bobp) + (not (eq (char-before (1- (point))) ?\\))))) + (c-end-of-macro) + (skip-chars-forward c-opt-cpp-symbol))) ((memq (char-after) non-skip-list) (throw 'done (point))))) ;; In trailing space after an as yet undetected virtual semicolon? -- Alan Mackenzie (Nuremberg, Germany). From unknown Tue Jun 17 01:50:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#15728: bug #15728: 24.3.50; cc-mode incorrectly parses particular macro Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Oct 2013 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15728 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 15728@debbugs.gnu.org Received: via spool by 15728-submit@debbugs.gnu.org id=B15728.13828995374334 (code B ref 15728); Sun, 27 Oct 2013 18:46:02 +0000 Received: (at 15728) by debbugs.gnu.org; 27 Oct 2013 18:45:37 +0000 Received: from localhost ([127.0.0.1]:47699 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaVLC-00017m-Mf for submit@debbugs.gnu.org; Sun, 27 Oct 2013 14:45:35 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:47429) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaVL9-00017d-NC for 15728@debbugs.gnu.org; Sun, 27 Oct 2013 14:45:32 -0400 Received: from compute2.internal (compute2.nyi.mail.srv.osa [10.202.2.42]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id E92A920BD2 for <15728@debbugs.gnu.org>; Sun, 27 Oct 2013 14:45:29 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sun, 27 Oct 2013 14:45:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:references:in-reply-to:date:message-id :mime-version:content-type; s=mesmtp; bh=eHPrbf3TZKStBDPPgxB0WCB eHgU=; b=gbExOU+ID9d+Ljg4SNzo1faxKh9ijM2gtRVJGR9UYXZaczNNkrear0K 6MaeHvroHuAZSHPbpAkK9ojgaVtgcfFVn1BvcnReLzk97K4ldgsQSP6mz2QBZv99 F8gOAiMFajtlZ60rM2T+uFg5cjRZ6wu7f8dyeIY37UHvVuDZsLgA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:references:in-reply-to :date:message-id:mime-version:content-type; s=smtpout; bh=eHPrbf 3TZKStBDPPgxB0WCBeHgU=; b=uOldcrlfoMETmGCPpjDrcQhrvodMIpTlDS8A6U jf4E0MQsbYxgKj8y+8O8wWWHiy9pg4ceHa3411n/30e3QKUBzLwqrdF51NcJvEbj nZIHqZOdqlwplfwALwgW04a+n3mtpolMvVJk20kpZh45khNd5S0DB+P2hYfHfbnz EHdJ8= X-Sasl-enc: qt5IkK9qotXqassZN1z/ECvU6YeRTBoKVfMwO1iyO3mK 1382899529 Received: from shorty.local (unknown [76.169.247.77]) by mail.messagingengine.com (Postfix) with ESMTPA id 46F266804E6 for <15728@debbugs.gnu.org>; Sun, 27 Oct 2013 14:45:29 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.80) (envelope-from ) id 1VaVL5-00079G-WC for 15728@debbugs.gnu.org; Sun, 27 Oct 2013 11:45:28 -0700 From: Dima Kogan References: <20131027134914.GA4412@acm.acm> User-agent: mu4e 0.9.9.5; emacs 24.3.50.1 In-reply-to: <20131027134914.GA4412@acm.acm> Date: Sun, 27 Oct 2013 11:45:27 -0700 Message-ID: <87bo2a1rjs.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Alan Mackenzie writes: > I think the following patch should fix it. Would you try it out, > please, and let me know how well it works. Hi Alan. I tried the patch and it does solve the issue for me. Thank you very much for fixing this issue so quickly. dima From unknown Tue Jun 17 01:50:23 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Dima Kogan Subject: bug#15728: closed (Re: bug #15728: 24.3.50; cc-mode incorrectly parses particular macro) Message-ID: References: <20131027215154.GA13002@acm.acm> <87d2mr1h83.fsf@secretsauce.net> X-Gnu-PR-Message: they-closed 15728 X-Gnu-PR-Package: emacs,cc-mode Reply-To: 15728@debbugs.gnu.org Date: Sun, 27 Oct 2013 21:55:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1382910903-22295-1" This is a multi-part message in MIME format... ------------=_1382910903-22295-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #15728: 24.3.50; cc-mode incorrectly parses particular macro which was filed against the emacs,cc-mode package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 15728@debbugs.gnu.org. --=20 15728: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D15728 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1382910903-22295-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 15728-done) by debbugs.gnu.org; 27 Oct 2013 21:54:02 +0000 Received: from localhost ([127.0.0.1]:47796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaYHZ-0005m3-HR for submit@debbugs.gnu.org; Sun, 27 Oct 2013 17:54:01 -0400 Received: from colin.muc.de ([193.149.48.1]:10845 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaYHX-0005lt-Bv for 15728-done@debbugs.gnu.org; Sun, 27 Oct 2013 17:53:59 -0400 Received: (qmail 11376 invoked by uid 3782); 27 Oct 2013 21:53:57 -0000 Received: from acm.muc.de (pD9518626.dip0.t-ipconnect.de [217.81.134.38]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 27 Oct 2013 22:53:56 +0100 Received: (qmail 13008 invoked by uid 1000); 27 Oct 2013 21:51:54 -0000 Date: Sun, 27 Oct 2013 21:51:54 +0000 To: 15728-done@debbugs.gnu.org Subject: Re: bug #15728: 24.3.50; cc-mode incorrectly parses particular macro Message-ID: <20131027215154.GA13002@acm.acm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 15728-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.2 (-) Bug fixed. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1382910903-22295-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 27 Oct 2013 04:16:42 +0000 Received: from localhost ([127.0.0.1]:46850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaHmM-0002sJ-0M for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41658) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VaHmJ-0002s4-QK for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaHm8-0000gX-0p for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHm7-0000gT-U0 for submit@debbugs.gnu.org; Sun, 27 Oct 2013 00:16:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHm2-0007HC-4U for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:16:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaHlw-0000f1-Ba for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:16:22 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:47471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaHlw-0000et-3o for bug-gnu-emacs@gnu.org; Sun, 27 Oct 2013 00:16:16 -0400 Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 2377520D4F for ; Sun, 27 Oct 2013 00:16:14 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Sun, 27 Oct 2013 00:16:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:date:message-id:mime-version:content-type; s= mesmtp; bh=Z7fbobtAivs48a+fbJjgapa7XNw=; b=qQqaqdhF3HVdVcFjbwh0R V8QLt51pwvuIciLk1BXl3U63m1PkdqaKYviLnauwNzAMwGWOXCW6nFJNmfHFWBGF K0gya0RLqSANuA1wPQ2vf6whzr8RrEsvzY7RYccszakjHjsJEw21DzJ6UCXSq4vt yzMmK1m/4DINebGgoZAhSI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:date:message-id :mime-version:content-type; s=smtpout; bh=Z7fbobtAivs48a+fbJjgap a7XNw=; b=UHBNHQF5ICFNvLWjzH/gICAd6fNUYScoA8w2zZLuIBPvrR3wqqWz7c YSZBXwZhkaX9uo3ki+RvcLsRhYd1MZU+olFk6CmIPUQgQDCSa5h67FICzNv2ve9j B6kJiSeJVdU/i4pWsVEcTVKb831I6idmAS7pMxi+OIaLZ0lrL2pZk= X-Sasl-enc: Ljgcclho2m+sD2ztZYFUd56eXc6kee1gK+n4cdDNC5Tz 1382847373 Received: from shorty.local (unknown [76.169.247.77]) by mail.messagingengine.com (Postfix) with ESMTPA id D14916800CB for ; Sun, 27 Oct 2013 00:16:13 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.80) (envelope-from ) id 1VaHls-0002IW-H7 for bug-gnu-emacs@gnu.org; Sat, 26 Oct 2013 21:16:12 -0700 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 24.3.50; cc-mode incorrectly parses particular macro Date: Sat, 26 Oct 2013 21:16:12 -0700 Message-ID: <87d2mr1h83.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I have the following source file: ========================================================================= int f(void) { #define A(b) \ int abc ## b; \ g() } ========================================================================= This indentation is what the latest emacs thinks is correct. Note that the g() line is indented ahead of the 'int abc' line. This is wrong; they should have the same indentation. Indeed this is what happens with emacs23. In the latest emacs the syntax parser thinks the g() line is 'statement-cont', instead of 'statement'; this is directly related to the issue. Furthermore, the 'abc ## b' construct is what's confusing the parser. Removing the '##' makes it parse correctly again. I'm observing this issue with all emacs24 builds I've tried, with 'emacs -Q'. ------------=_1382910903-22295-1--