From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35768: 27.0.50; CC-Mode problems with function definitions with macro names Date: Thu, 16 May 2019 19:42:55 -0400 Message-ID: <87k1eqdkzk.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="97677"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35768@debbugs.gnu.org To: Mauro Aranda Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 17 01:44:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRQ2r-000PHm-Tp for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2019 01:44:18 +0200 Original-Received: from localhost ([127.0.0.1]:38489 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRQ2q-0008Fb-9p for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 May 2019 19:44:16 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRQ2j-0008FS-31 for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 19:44:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRQ2h-0003zy-Q5 for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 19:44:08 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43205) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRQ2b-0003uv-RO; Thu, 16 May 2019 19:44:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hRQ2b-0000Je-Om; Thu, 16 May 2019 19:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 16 May 2019 23:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35768 X-GNU-PR-Package: emacs,cc-mode Original-Received: via spool by 35768-submit@debbugs.gnu.org id=B35768.15580501851113 (code B ref 35768); Thu, 16 May 2019 23:44:01 +0000 Original-Received: (at 35768) by debbugs.gnu.org; 16 May 2019 23:43:05 +0000 Original-Received: from localhost ([127.0.0.1]:56747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRQ1g-0000Ht-QZ for submit@debbugs.gnu.org; Thu, 16 May 2019 19:43:05 -0400 Original-Received: from mail-it1-f173.google.com ([209.85.166.173]:50236) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRQ1f-0000HK-4a for 35768@debbugs.gnu.org; Thu, 16 May 2019 19:43:03 -0400 Original-Received: by mail-it1-f173.google.com with SMTP id i10so9114072ite.0 for <35768@debbugs.gnu.org>; Thu, 16 May 2019 16:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=nbesGsOXZGn4BRBx9aFsTWLreP+A3Wl9pnfzn5m+XvI=; b=JcbEtxZlz/OrDS9ZxbGXLB7KwWAXtyXu4USu1CIi51nEnmnX6Q66IOOqVsI6BWE/ND cWD8KGPOOxBVHybazTXbsOwG0NW3+inng7DlG7un2jCb0GgvyT7DKVAbVCVUg19ns+1u J09wXIX61asr24Ez34dudxVr3WytwXuVf3ZIWDCYNXCiP9BNkbYLIW0z+A9om9WfC32l ffYhoD8vix6wjHLJiuxcXkskmV1vr7319AvkJdtb9Phd/8RKqEG+mvXetX1GIy9Xu3n9 6Uoie3vvTTWaNLqxcyq9Hew7RqQEIM6qce7YUzKXabBax+fsHf+LiwO5L6KckgXjPqNl u2HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=nbesGsOXZGn4BRBx9aFsTWLreP+A3Wl9pnfzn5m+XvI=; b=Zyygx2amTOr7a5lsT1Y04Cg3kpexhSoz+TDJc5+7f6qQuULQ6CLFhCSly6+rSs1G4w TzW7i+JuKerBND5GHQ18TLOaCKI+v/bsZTJ2sEuFqtM6njZohdjZ3sxq90Af4EVYC9Ns u0cgcz79snqGn+G8GOznCzoTOAkme1myX5hdUimgU8r6yM+i4WtWDBb31Wp+bEXMLkwZ R0cNG0OaUu0HD44vRaVaB2msWf2MYKIc0SyuNaiUHBl+TZ3z2+bZnC6VfEzLkHBdLzvI jiE5EOeXXr4JagctEj51/ae59ciG0gdhML1s1IMo5JxemaqhRapU9QmfScc4fojYsI6W dr+Q== X-Gm-Message-State: APjAAAXu4jWE8++usMW0x9t+bOt1fZtWTjj4SheI7ATzTZCdm3LUjlrq rGH8tGRkBhMD+/y4UMNPTAxtgQjM X-Google-Smtp-Source: APXvYqx/aT+LoDAaxj8eoaYqxzvpbYRgtBfZcQN7VEoT3oMS1TGj1SqfKeB9GzzXiNeOb2/bmmh5Kg== X-Received: by 2002:a24:47c2:: with SMTP id t185mr256824itb.97.1558050177336; Thu, 16 May 2019 16:42:57 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id e23sm2356966iob.43.2019.05.16.16.42.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 May 2019 16:42:56 -0700 (PDT) In-Reply-To: (Mauro Aranda's message of "Thu, 16 May 2019 19:19:09 -0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.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" Xref: news.gmane.org gmane.emacs.bugs:159423 Archived-At: Mauro Aranda writes: > I noticed CC-Mode sometimes doesn't identify correctly function names > when a macro name is involved in the function definition. Try the > following recipe to see the problem: > > 1) emacs -Q > 2) C-x C-f test.c > 3) Type the following function definitions: > > int DUMMY > foo (void) > { > return 1; > } > > DUMMY int > bar (void) > { > return 0; > } > > 4) Observe that: > a) foo doesn't get fontified with font-lock-function-name-face, but > DUMMY does. Consequently, C-c C-z inside foo echoes > DUMMY as the function name, in the echo area. > b) In bar, DUMMY gets font-lock-type-face, which I don't > think is correct. bar gets font-lock-function-name-face and C-c C-z > works as expected. > > --- > > Other problem is with fontification of the return type in the following: > > bool DUMMY > baz_t (void) > { > return true; > } > > bool > baz_f (void) > { > return false; > } > > Observe that bool doesn't get fontified in baz_t, but DUMMY does. When > DUMMY is not present, bool gets fontified correctly (as in baz_f). > > > If it helps, I found the problem in a source file with functions that > have macros that declare some function attributes, like > _GL_ATTRIBUTE_PURE. Have you tried customizing c-noise-macro-names, as described in (ccmode) Noise Macros?