unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: "Mattias Engdegård" <mattiase@acm.org>
Cc: "Daniel Martín" <mardani29@yahoo.es>, 51882@debbugs.gnu.org
Subject: bug#51882: Handle GCC's -fanalyzer output in M-x compile
Date: Tue, 23 Nov 2021 18:14:38 +0000	[thread overview]
Message-ID: <87mtluhh81.fsf@posteo.net> (raw)
In-Reply-To: <F5178FDD-CCEC-4E78-8D4A-4E82B5F8A9E8@acm.org> ("Mattias Engdegård"'s message of "Tue, 23 Nov 2021 16:35:39 +0100")

Mattias Engdegård <mattiase@acm.org> writes:

> Would it be possible to see a full example, with context, of the message emitted by GCC?
> I would like to understand what, exactly, this regexp is supposed to
> be parsing. I've simplified the regexp in compile.el a little but want
> to be sure that I'm not making any mistakes.

Here is a snippet from a program I was working on:

--8<---------------cut here---------------start------------->8---
board.c:319:13: error: leak of 'move' [CWE-401] [-Werror=analyzer-malloc-leak]                                                               
  319 |      return (int16_t) changed;                                                                                                       
      |             ^~~~~~~~~~~~~~~~~                                                                                                        
  'place_stone': events 1-2                                                                                                                  
    |                                                                                                                                        
    |  387 | place_stone(struct Board *b, enum Stone s, struct Coord c)                                                                     
    |      | ^~~~~~~~~~~                                                                                                                    
    |      | |                                                                                                                               
    |      | (1) entry to 'place_stone'                                                                                                     
    |  388 | {                                                                                                                               
    |  389 |      if (!valid_move(b, s, c)) {                                                                                                
    |      |         ~                                                                                                                       
    |      |         |                                                                                                                       
    |      |         (2) following 'false' branch...                                                                                         
    |                                                                                                                                        
  'place_stone': event 3                                                                                                                     
    |                                                                                                                                        
    |board.h:60:21:
    |   60 | #define I(b, C) ((C).y * (b)->width + (C).x)      /* coord -> index */                                                                                         
    |      |                  ~~~^~                                                                                                          
    |      |                     |                                                                                                           
    |      |                     (3) ...to here                                                                                              
board.h:61:34: note: in expansion of macro 'I'                                                                                              
    |   61 | #define stone_at(b, c) (b->board[I(b, c)])                                                                                      
    |      |                                  ^                                                                                              
board.c:393:6: note: in expansion of macro 'stone_at'                                                                                       
    |  393 |      stone_at(b, c) = s;                                                                                                        
    |      |      ^~~~~~~~                                                                                                                   
    |                                                                                                                                        
  'place_stone': event 4                                                                                                                     
    |                                                                                                                                        
    |  395 |      return update_board(b, c);                                                                                                 
    |      |             ^~~~~~~~~~~~~~~~~~                                                                                                  
    |      |             |                                                                                                                   
    |      |             (4) calling 'update_board' from 'place_stone'                                                                       
    |                                                                                                                                        
    +--> 'update_board': events 5-8                                                                                                          
--8<---------------cut here---------------end--------------->8---

Notice how the

--8<---------------cut here---------------start------------->8---
    |board.h:60:21:
--8<---------------cut here---------------end--------------->8---

wouldn't be matched correctly using the previous regexp.

For reference, this is my GCC version:

gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

-- 
	Philip Kaludercic





  reply	other threads:[~2021-11-23 18:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 23:13 bug#51882: Handle GCC's -fanalyzer output in M-x compile Philip Kaludercic
2021-11-16  8:13 ` Lars Ingebrigtsen
2021-11-16 10:28 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-17 20:21   ` Philip Kaludercic
2021-11-23 15:35 ` Mattias Engdegård
2021-11-23 18:14   ` Philip Kaludercic [this message]
2021-11-23 20:03     ` Mattias Engdegård
2021-11-25  9:24     ` Mattias Engdegård

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=87mtluhh81.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=51882@debbugs.gnu.org \
    --cc=mardani29@yahoo.es \
    --cc=mattiase@acm.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).