From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda 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:19:09 -0300 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000069d55c058908a845" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="267218"; mail-complaints-to="usenet@blaine.gmane.org" To: 35768@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 17 00:20:15 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 1hROjW-0017OD-Ty for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2019 00:20:15 +0200 Original-Received: from localhost ([127.0.0.1]:37584 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hROjV-0002DO-LR for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 May 2019 18:20:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hROjL-0002C6-K6 for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 18:20:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hROjK-0006Uo-1l for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 18:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43133) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hROjJ-0006Uj-V2 for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 18:20:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hROjJ-0006Lp-OU for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 18:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 May 2019 22:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35768 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.155804518124373 (code B ref -1); Thu, 16 May 2019 22:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 May 2019 22:19:41 +0000 Original-Received: from localhost ([127.0.0.1]:56676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hROiy-0006L3-T8 for submit@debbugs.gnu.org; Thu, 16 May 2019 18:19:41 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hROiw-0006Ko-I5 for submit@debbugs.gnu.org; Thu, 16 May 2019 18:19:39 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hROiq-0005Yz-Lc for submit@debbugs.gnu.org; Thu, 16 May 2019 18:19:32 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:60877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hROio-0002Ar-OD for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 18:19:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hROim-0005Rr-RP for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 18:19:30 -0400 Original-Received: from mail-lf1-x136.google.com ([2a00:1450:4864:20::136]:38643) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hROil-0005Lc-0S for bug-gnu-emacs@gnu.org; Thu, 16 May 2019 18:19:27 -0400 Original-Received: by mail-lf1-x136.google.com with SMTP id y19so3847388lfy.5 for ; Thu, 16 May 2019 15:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=OI0m12DgB+zxFosSQ2y6IOzaryJmIhWuY1YaJTIlmZU=; b=FLlhNp3Dh3/PRivdtvZJDfsa470SxbjCN8e8innSSrFvFiJGIVZFiTXMo45tyxs8sL UaJHo9e2f+uuxHPT79lTGnRyPFxsju+neYVNF9SIXlWnCWG7OX1o2i4cIdqqa7kPUMAK MgfxegBarq6R5tMgoK3YvEe94s4Fn2bpbHJ3in4v8Ary3LS4JXUPn266Scwt9uJKxeNC c+lqTpasd5zdFJoHHP6dypZLVuaLg+8gLAUTSaYKnTW6kAJnC/6QUUlzLIRBBAnpgsa9 +vFqj7g+V5GAKv7dis2bC8rjrvGB+fdSfK+vXAUj7egl6qLH+mtvqIFX+wrBj/Qbf6W+ u43Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=OI0m12DgB+zxFosSQ2y6IOzaryJmIhWuY1YaJTIlmZU=; b=e1TBqICCoVT7MfIeOZeo3Q9QDWdPMAuXSJ7IRmjr2zb/T0j8FzKe9qtogLb6MitHWR LQFUgQ8Ilh5lRfZBII8gDQPsup3GVtkoUd/yIHJ5PeomPUgU1Syc3MTUT/Iw64+L80Ao BUjbKkI+VWUCNuBgvxD804WjgNz6QR9vikh4kld5Whg+N97EApMGqVeMaJkV9MJFHqR4 eA0V449V4TMxjeLo5K04xnltbypxY7HMOUtEiDYgt5MKy3g+FKPp6LGaISFjtgQYNQGQ CTpnaegsnhCXwMfti83Vm2tjq3Z5XIOWxVPh0rAHZH2KHZpH6Yc/SvujtFlb/eCWTI+J w7ew== X-Gm-Message-State: APjAAAXm9wRk98KPnnwNCtUsf74UmfBjWHt8ttLeJ76hpSVNQkRNOtyw sLCB1qoOmDqsuQZJfm8jE72GJshAGuIpNXyd1AE4GIQh X-Google-Smtp-Source: APXvYqw3irIrTxHDR/VunqE7KTKbVmoFJBNdrF1RDP4RrxPoP7clpCYxmDSDCWWbm4/y0WhjejoRDATV6/JgW/NhCO8= X-Received: by 2002:ac2:4a6e:: with SMTP id q14mr7464981lfp.46.1558045161803; Thu, 16 May 2019 15:19:21 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:159420 Archived-At: --00000000000069d55c058908a845 Content-Type: text/plain; charset="UTF-8" Hello. 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. Best regards, Mauro. In GNU Emacs 27.0.50 (build 5, i686-pc-linux-gnu, GTK+ Version 3.18.9) of 2019-05-15 built on the-blackbeard Repository revision: 50b1ce0185cd7b5f8be124eb4a612fd56e4e0657 Repository branch: revert-buffer-with-fine-grain Windowing system distributor 'The X.Org Foundation', version 11.0.11906000 System Description: Ubuntu 16.04.6 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure CFLAGS=-O3' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS PDUMPER LCMS2 GMP Important settings: value of $LANG: en_US.utf8 value of $XMODIFIERS: locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv bytecomp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils elec-pair mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 8 43995 8711) (symbols 24 5878 1) (strings 16 14997 2517) (string-bytes 1 501374) (vectors 8 8875) (vector-slots 4 114380 10618) (floats 8 18 13) (intervals 28 194 0) (buffers 564 11) (heap 1024 7599 790)) --00000000000069d55c058908a845 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello.

I noticed CC-Mode sometimes= doesn't identify correctly function names
when a macro name is invo= lved in the function definition.=C2=A0 Try the
following recipe to see t= he problem:

1) emacs -Q
2) C-x C-f test.c
3) Type the followin= g function definitions:

int DUMMY
foo (void)
{
=C2=A0 retur= n 1;
}

DUMMY int
bar (void)
{
=C2=A0 return 0;
}
<= br>4) Observe that:
a) foo doesn't get fontified with font-lock-func= tion-name-face, but
DUMMY does.=C2=A0 Consequently, C-c C-z inside foo e= choes
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.=C2=A0 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 fo= llowing:

bool DUMMY
baz_t (void)
{
=C2=A0 return true;
}=

bool
baz_f (void)
{
=C2=A0 return false;
}

Obser= ve that bool doesn't get fontified in baz_t, but DUMMY does.=C2=A0 When=
DUMMY is not present, bool gets fontified correctly (as in baz_f).
<= br>
If it helps, I found the problem in a source file with functions tha= t
have macros that declare some function attributes, like
_GL_ATTRIBU= TE_PURE.

Best regards,
Mauro.



In GNU Emacs 27.0.50= (build 5, i686-pc-linux-gnu, GTK+ Version 3.18.9)
=C2=A0of 2019-05-15 b= uilt on the-blackbeard
Repository revision: 50b1ce0185cd7b5f8be124eb4a61= 2fd56e4e0657
Repository branch: revert-buffer-with-fine-grain
Windowi= ng system distributor 'The X.Org Foundation', version 11.0.11906000=
System Description: Ubuntu 16.04.6 LTS

Recent messages:
For i= nformation about GNU Emacs and the GNU system, type C-h C-a.

Configu= red using:
=C2=A0'configure CFLAGS=3D-O3'

Configured feat= ures:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY IN= OTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIBTOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM THREADS PDUMPER LCMS2 GMP

Imp= ortant settings:
=C2=A0 value of $LANG: en_US.utf8
=C2=A0 value of $X= MODIFIERS:
=C2=A0 locale-coding-system: utf-8-unix

Major mode: L= isp Interaction

Minor modes in effect:
=C2=A0 tooltip-mode: t
= =C2=A0 global-eldoc-mode: t
=C2=A0 eldoc-mode: t
=C2=A0 electric-inde= nt-mode: t
=C2=A0 mouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2= =A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-fo= nt-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t<= br>=C2=A0 auto-composition-mode: t
=C2=A0 auto-encryption-mode: t
=C2= =A0 auto-compression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 transi= ent-mark-mode: t

Load-path shadows:
None found.

Features:<= br>(shadow sort mail-extr emacsbug message rmc puny seq byte-opt gv
byte= comp byte-compile cconv dired dired-loaddefs format-spec rfc822 mml
easy= menu mml-sec password-cache epa derived epg epg-config gnus-util
rmail r= mail-loaddefs text-property-search time-date mm-decode mm-bodies
mm-enco= de mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib= sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
elec-= pair mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-= float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fo= ntset image regexp-opt fringe tabulated-list replace newcomment
text-mod= e elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isea= rch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu fon= t-core term/tty-colors frame cl-generic cham georgian
utf-8-lang misc-la= ng vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932= hebrew greek romanian slovak czech european
ethiopic indian cyrillic ch= inese composite charscript charprop
case-table epa-hook jka-cmpr-hook he= lp simple abbrev obarray minibuffer
cl-preloaded nadvice loaddefs button= faces cus-face macroexp files
text-properties overlay sha1 md5 base64 f= ormat env code-pages mule
custom widget hashtable-print-readable backquo= te threads dbusbind
inotify lcms2 dynamic-setting system-font-setting fo= nt-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-pr= ocess emacs)

Memory information:
((conses 8 43995 8711)
=C2=A0= (symbols 24 5878 1)
=C2=A0(strings 16 14997 2517)
=C2=A0(string-bytes= 1 501374)
=C2=A0(vectors 8 8875)
=C2=A0(vector-slots 4 114380 10618)=
=C2=A0(floats 8 18 13)
=C2=A0(intervals 28 194 0)
=C2=A0(buffers = 564 11)
=C2=A0(heap 1024 7599 790))

--00000000000069d55c058908a845--