[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45246: 28.0.50; etags assertion error
From: |
Eli Zaretskii |
Subject: |
bug#45246: 28.0.50; etags assertion error |
Date: |
Thu, 09 Jun 2022 20:42:41 +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?
- bug#45246: 28.0.50; etags assertion error, Lars Ingebrigtsen, 2022/06/07
- bug#45246: 28.0.50; etags assertion error, Eli Zaretskii, 2022/06/07
- bug#45246: 28.0.50; etags assertion error,
Eli Zaretskii <=
- bug#45246: 28.0.50; etags assertion error, Lars Ingebrigtsen, 2022/06/09
- bug#45246: 28.0.50; etags assertion error, Eli Zaretskii, 2022/06/09
- bug#45246: 28.0.50; etags assertion error, Gregor Zattler, 2022/06/09
- bug#45246: 28.0.50; etags assertion error, Eli Zaretskii, 2022/06/10
- bug#45246: 28.0.50; etags assertion error, Eli Zaretskii, 2022/06/10
- bug#45246: 28.0.50; etags assertion error, Francesco Potortì, 2022/06/10
- bug#45246: 28.0.50; etags assertion error, Lars Ingebrigtsen, 2022/06/07