unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: grfz@gmx.de, larsi@gnus.org
Cc: 45246@debbugs.gnu.org
Subject: bug#45246: 28.0.50; etags assertion error
Date: Thu, 09 Jun 2022 20:42:41 +0300	[thread overview]
Message-ID: <83zgil20oe.fsf@gnu.org> (raw)
In-Reply-To: <83y1y85rko.fsf@gnu.org> (message from Eli Zaretskii on Tue, 07 Jun 2022 20:08:55 +0300)

> Date: Tue, 07 Jun 2022 20:08:55 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: grfz@gmx.de, larsi@gnus.org, 45246@debbugs.gnu.org
> 
> > Cc: larsi@gnus.org, 45246@debbugs.gnu.org
> > Date: Tue, 07 Jun 2022 18:58:13 +0300
> > From: Eli Zaretskii <eliz@gnu.org>
> > 
> > > $ /home/grfz/src/emacs/lib-src/etags /usr/include/xapian/unicode.h
> > > etags: etags.c:4188: C_entries: Assertion `bracelev == typdefbracelev' failed.
> > > Aborted
> > 
> > Lars, I guess you were trying this in an optimized build, where all
> > the assertions compile to nothing.
> > 
> > I see this here and will try to take a look when I have time.
> 
> A much smaller test case:
> 
> namespace Unicode {
> 
> typedef enum {
>     UNASSIGNED,
>     OTHER_SYMBOL
> } category;
> 
> }
> 
> Hmm...

Heh, turns out it's a "feature": when etags sees a closing brace in
column zero, it by default assumes that's the final brace of a
function or a struct definition, so it resets the brace level.  As you
can see, the above test case (and the original Unicode.h) have the
closing brace of the "typedef enum" in column zero.  If you mark the
entire typedef and type "M-C-\", Emacs will indent it, and the problem
will go away.

"etags --help" says:

  -I, --ignore-indentation
	  In C and C++ do not assume that a closing brace in the first
	  column is the final brace of a function or structure definition.

And indeed, invoking "etags -I" compiled with --enable-checking with
the original file avoids the assertion violation.  And in a production
build, etags produces a valid TAGS file even if -I is omitted.

So I think there's nothing to do here, and we should close this bug as
notabug.  Does anyone disagree?





  reply	other threads:[~2022-06-09 17:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 23:38 bug#45246: 28.0.50; etags assertion error Gregor Zattler
2022-06-07 11:35 ` Lars Ingebrigtsen
2022-06-07 14:26   ` Gregor Zattler
2022-06-07 15:58     ` Eli Zaretskii
2022-06-07 16:38       ` Andreas Schwab
2022-06-07 17:15         ` Eli Zaretskii
2022-06-07 17:34           ` Andreas Schwab
2022-06-07 18:25             ` Eli Zaretskii
2022-06-07 17:08       ` Eli Zaretskii
2022-06-09 17:42         ` Eli Zaretskii [this message]
2022-06-09 18:43           ` Lars Ingebrigtsen
2022-06-09 18:59             ` Eli Zaretskii
2022-06-09 22:33               ` Gregor Zattler
2022-06-10  7:25                 ` Eli Zaretskii
2022-06-10  7:26                 ` Eli Zaretskii
2022-06-10 14:01                   ` Francesco Potortì
2022-06-07 17:13       ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zgil20oe.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=45246@debbugs.gnu.org \
    --cc=grfz@gmx.de \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).