public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/65119] New: -fmessage-length= counts control characters when wrapping the caret line
Date: Thu, 19 Feb 2015 13:29:00 -0000	[thread overview]
Message-ID: <bug-65119-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65119

            Bug ID: 65119
           Summary: -fmessage-length= counts control characters when
                    wrapping the caret line
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manu at gcc dot gnu.org

struct {
  int y;
} x;
#define FOO                                                                    
                                                              x*x
void foo()
{
  FOO;
}


~/test1/220306M/build/gcc/cc1 test.c -fmessage-length=10
-fdiagnostics-color=always
foo
test.c: In
   function

   ‘foo’
:
test.c:4:144: error: invalid
   operands
   to 
   binary 
   * 
   (have 
   ‘struct

   <anonymous>’
    and 
   ‘struct

   <anonymous>’
   )
       x*x



^
test.c:7:3: note: in
   expansion
   of 
   macro 
   ‘FOO’
   FOO;


  ^

The reason is that pp_string()
https://github.com/gcc-mirror/gcc/blob/master/gcc/diagnostic.c#L384 counts
control characters (such as the color codes) when deciding whether to wrap
around, however those characters are not normally visible thus they produce a
strange effect. In general, the whole pretty-printer wrapping is oblivious to
the color codes, which is likely to produce excessive wrapping when using
-fmessage-length=.
>From gcc-bugs-return-477775-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Feb 19 13:30:30 2015
Return-Path: <gcc-bugs-return-477775-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23555 invoked by alias); 19 Feb 2015 13:30:28 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 23443 invoked by uid 48); 19 Feb 2015 13:30:20 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/65012] [5 Regression] systemd fails to build at least on ppc64el, powerpc, arm-inux-gnueabihf and aarch64 with -flto (ICE)
Date: Thu, 19 Feb 2015 13:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-65012-4-r60VfLjeIV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65012-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65012-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-02/txt/msg02108.txt.bz2
Content-length: 422

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide012

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


                 reply	other threads:[~2015-02-19 13:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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

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

  git send-email \
    --in-reply-to=bug-65119-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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.
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).