GNU bug report logs - #62560
28.2; compile-mode misidentifies compiler output

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Fri, 31 Mar 2023 05:39:02 UTC

Severity: normal

Found in version 28.2

To reply to this bug, email your comments to 62560 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#62560; Package emacs. (Fri, 31 Mar 2023 05:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tom Tromey <tom <at> tromey.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 31 Mar 2023 05:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tom Tromey <tom <at> tromey.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.2; compile-mode misidentifies compiler output
Date: Thu, 30 Mar 2023 23:37:43 -0600
Put the text between the "===" lines into a file, say /tmp/F.
Then M-x compile and for the compile command use "cat /tmp/F".

For me, the "| ... unsigned char :3" lines are partly highlighted as if
they are error messages, and next-error will erroneously try to select
these.

These lines occur because gcc prints some of the source code in the
error message.  I think Emacs should not treat them as if they explain
the location of an error.

================================================================
make[2]: Entering directory '/home/tromey/gdb/build/gdb'
  CXX    psymtab.o
../../binutils-gdb/gdb/psymtab.c: In function ‘void maintenance_check_psymtabs(const char*, int)’:
../../binutils-gdb/gdb/psymtab.c:1614:52: error: could not convert ‘psym->partial_symbol::domain’ from ‘unsigned char:3’ to ‘domain_search_flags’ {aka ‘enum_flags<domain_search_flag>’}
 1614 |                                              psym->domain);
      |                                              ~~~~~~^~~~~~
      |                                                    |
      |                                                    unsigned char:3
../../binutils-gdb/gdb/psymtab.c:1629:52: error: could not convert ‘psym->partial_symbol::domain’ from ‘unsigned char:3’ to ‘domain_search_flags’ {aka ‘enum_flags<domain_search_flag>’}
 1629 |                                              psym->domain);
      |                                              ~~~~~~^~~~~~
      |                                                    |
      |                                                    unsigned char:3
make[2]: *** [Makefile:1920: psymtab.o] Error 1
================================================================



In GNU Emacs 28.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.35, cairo version 1.17.6)
 of 2023-01-28 built on buildvm-x86-25.iad2.fedoraproject.org
Windowing system distributor 'The X.Org Foundation', version 11.0.12201008
System Description: Fedora Linux 36 (Workstation Edition)

Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xpm --with-x-toolkit=gtk3 --with-gpm=no
 --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json
 --with-native-compilation build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2
 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches
 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -Wp,-D_GLIBCXX_ASSERTIONS
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  shell-dirtrack-mode: t
  which-function-mode: t
  erc-services-mode: t
  erc-networks-mode: t
  savehist-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/tromey/.emacs.d/elpa/bubbles-0.5/bubbles hides /usr/share/emacs/28.2/lisp/play/bubbles
/home/tromey/.emacs.d/elpa/dictionary-1.10/dictionary hides /usr/share/emacs/28.2/lisp/net/dictionary

Features:
(shadow emacsbug modula2 smie python tramp-sh vc-annotate f90 cus-edit
cus-start asm-mode mailalias supercite regi mail-hist shr-color
mm-archive mule-util tcl dwarf-mode org-bullets org-element avl-tree
ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus
nnselect gnus-search eieio-opt speedbar ezimage dframe ol-docview
doc-view jka-compr image-mode exif ol-bibtex ol-bbdb ol-w3m ol-doi
org-link-doi org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src ob-comint org-pcomplete org-list org-faces
org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval
org-table oc-basic bibtex ol org-keys oc org-compat org-macs
org-loaddefs find-func term/xterm xterm pulse find-dired ffap gud
goto-addr log-edit dabbrev find-file copyright ggtags hippie-exp etags
fileloop generator xref project bug-reference smerge-mode diff cc-mode
cc-fonts cc-guess cc-menus cc-cmds log-view pcvs-util vc-mtn vc-hg
vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs sort smiley
gnus-cite mail-extr gnus-async gnus-bcklg qp gnus-ml disp-table misearch
multi-isearch gnus-topic nndraft nnmh nnfolder utf-7 gnutls
network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual
gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig nntp
gnus-cache gnus-sum shr kinsoku svg dom gnus-group gnus-undo smtpmail
sendmail gnus-start gnus-dbus dbus gnus-cloud nnimap nnmail mail-source
utf7 netrc nnoo gnus-spec gnus-int gnus-range message rmc puny dired
dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config
mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils
mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047
rfc2045 ietf-drums mail-utils mm-util mail-prsvr add-log flyspell ispell
diminish projectile ibuf-macs pcase edmacro kmacro grep compile
text-property-search ibuf-ext ibuffer ibuffer-loaddefs dash appt
diary-lib diary-loaddefs cal-menu calendar cal-loaddefs tramp
tramp-loaddefs trampver tramp-integration files-x tramp-compat shell
pcomplete parse-time ls-lisp which-func imenu minimap autorevert
filenotify cus-load erc-track erc-match erc-services erc-networks
erc-hl-nicks easy-mmode color erc-button erc-fill erc-stamp wid-edit
erc-goodies erc erc-backend iso8601 time-date thingatpt pp format-spec
erc-loaddefs comp comp-cstr rx cl-extra help-mode warnings advice vc-dir
ewoc vc vc-dispatcher cc-styles cc-align cc-engine cc-vars cc-defs
ange-ftp comint ansi-color ring server savehist clang-rename
clang-include-fixer let-alist clang-format xml finder-inf
gdb-shell-autoloads lisppaste-autoloads pydoc-info-autoloads info-look
info cl weblogger-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core
cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl
tooltip eldoc paren electric uniquify ediff-hook vc-hooks
lisp-float-type elisp-mode 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 lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer 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 emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify dynamic-setting system-font-setting
font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 1714013 158817)
 (symbols 48 57899 16)
 (strings 32 168379 19915)
 (string-bytes 1 7108390)
 (vectors 16 98085)
 (vector-slots 8 2538401 323345)
 (floats 8 506 567)
 (intervals 56 201434 1380)
 (buffers 992 316))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62560; Package emacs. (Fri, 31 Mar 2023 06:10:02 GMT) Full text and rfc822 format available.

Message #8 received at 62560 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tom Tromey <tom <at> tromey.com>
Cc: 62560 <at> debbugs.gnu.org
Subject: Re: bug#62560: 28.2; compile-mode misidentifies compiler output
Date: Fri, 31 Mar 2023 09:09:12 +0300
> From: Tom Tromey <tom <at> tromey.com>
> Date: Thu, 30 Mar 2023 23:37:43 -0600
> 
> 
> Put the text between the "===" lines into a file, say /tmp/F.
> Then M-x compile and for the compile command use "cat /tmp/F".
> 
> For me, the "| ... unsigned char :3" lines are partly highlighted as if
> they are error messages, and next-error will erroneously try to select
> these.
> 
> These lines occur because gcc prints some of the source code in the
> error message.  I think Emacs should not treat them as if they explain
> the location of an error.

Any idea how to accomplish that, given that GCC emits unformatted and
unstructured text?  We could complicate the heck out of our regexps,
but theoretically a compiler could emit an error message that quotes
text that looks exactly as warning/error message, and what do we do
then?

Are there any developments in compilers to produce structured text,
like JSON or XML?  If so, it is probably better for us to use that
when available, because otherwise I see no way of solving these cases
100%.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62560; Package emacs. (Fri, 31 Mar 2023 15:02:02 GMT) Full text and rfc822 format available.

Message #11 received at 62560 <at> debbugs.gnu.org (full text, mbox):

From: Tom Tromey <tom <at> tromey.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Tom Tromey <tom <at> tromey.com>, 62560 <at> debbugs.gnu.org
Subject: Re: bug#62560: 28.2; compile-mode misidentifies compiler output
Date: Fri, 31 Mar 2023 09:01:42 -0600
>>>>> "Eli" == Eli Zaretskii <eliz <at> gnu.org> writes:

Eli> Any idea how to accomplish that, given that GCC emits unformatted and
Eli> unstructured text?

Maybe ignore lines starting with whitespace and then "|"?

Eli> We could complicate the heck out of our regexps,
Eli> but theoretically a compiler could emit an error message that quotes
Eli> text that looks exactly as warning/error message, and what do we do
Eli> then?

Yeah... keep on patching I suppose.

Eli> Are there any developments in compilers to produce structured text,
Eli> like JSON or XML?

In

(info "(gcc) Diagnostic Message Formatting Options")

I see:

'-fdiagnostics-format=FORMAT'
     Select a different format for printing diagnostics.  FORMAT is
     'text' or 'json'.  The default is 'text'.

I guess it could be made to work, though to be really useful I think
Emacs would have to reformat this before inserting in the compilation
buffer; but also it doesn't really solve the problem because while gcc
does this, many other tools run by make do not.

Tom




This bug report was last modified 1 year and 25 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.