From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#25987: 25.2; support gcc fixit notes Date: Tue, 06 Oct 2020 21:37:03 +0300 Message-ID: <83o8lf9p68.fsf@gnu.org> References: <87lgsj1jle.fsf@tromey.com> <1521218887.2913.237.camel@redhat.com> <83muz7pyde.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33790"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 25987@debbugs.gnu.org To: David Malcolm Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 06 20:45:30 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPrxp-0008fd-F5 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Oct 2020 20:45:29 +0200 Original-Received: from localhost ([::1]:47280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPrxo-0002d0-Ec for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 06 Oct 2020 14:45:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPrqc-0002Je-DW for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2020 14:38:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42581) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPrqc-00073o-3e for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2020 14:38:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kPrqc-0004TO-2G for bug-gnu-emacs@gnu.org; Tue, 06 Oct 2020 14:38:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Oct 2020 18:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25987 X-GNU-PR-Package: emacs Original-Received: via spool by 25987-submit@debbugs.gnu.org id=B25987.160200943117119 (code B ref 25987); Tue, 06 Oct 2020 18:38:02 +0000 Original-Received: (at 25987) by debbugs.gnu.org; 6 Oct 2020 18:37:11 +0000 Original-Received: from localhost ([127.0.0.1]:54118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPrpn-0004S3-Bj for submit@debbugs.gnu.org; Tue, 06 Oct 2020 14:37:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:51790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kPrpi-0004RY-LD for 25987@debbugs.gnu.org; Tue, 06 Oct 2020 14:37:10 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57259) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPrpc-0006zT-Jg; Tue, 06 Oct 2020 14:37:01 -0400 Original-Received: from [176.228.60.248] (port=4282 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kPrpb-0003nT-8q; Tue, 06 Oct 2020 14:37:00 -0400 In-Reply-To: (message from David Malcolm on Tue, 06 Oct 2020 14:17:55 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189926 Archived-At: > From: David Malcolm > Cc: 25987@debbugs.gnu.org > Date: Tue, 06 Oct 2020 14:17:55 -0400 > > In GCC 11 we've revamped the column number handling in how we emit > diagnostics; see: > https://gcc.gnu.org/pipermail/gcc-patches/2020-October/555632.html > > GCC 11 diagnostics now (by default) should use actual column numbers, > rather than byte counts. That's good news, thanks. > We haven't changed -fdiagnostics-parseable-fixits; it still emits its > range information in terms of byte offsets (and e.g. Eclipse already > consumes that option); this is bug-for-bug compatible with clang, I > believe (which had that option first). So fixit hints will still count bytes? Or will GCC 11 emit such hints even without -fdiagnostics-parseable-fixits on the command line? > Note that characters != columns, or, at least, we have to be careful > about what we mean. Consider the case of 🙂 aka SLIGHTLY SMILING FACE > (U+1F642) which is a single unicode code point, but occupies two > columns, with its UTF-8 encoding requiring four bytes. > > When I type it into an Emacs buffer, and look at the column number I > see that Emacs appears to treat the character as occupying two columns. > Is that the kind of column numbering you would want for machine- > readable fix-it hints? Yes. Emacs computes the width of each character by using UCD, the Unicode Character Database (specifically, the EastAsianWidth.txt file that is part of the UCD). If GCC gets its column counts from a similar DB, then it will match what Emacs does. > Similarly, the column numbering emitted by GCC 11 diagnostics is > affected by tab characters as tab stops, which seems to reflect Emacs > behavior as well. Yes. > I can add an additional option for fix-it hints that's similar to > -fdiagnostics-parseable-fixits, but with a different output format (or > to add an argument to that option, perhaps). If an option is needed for getting the hints, then a special option which reports columns in hints will be appreciated, as it will make the Emacs support for processing those hints 100% accurate and devoid of encoding guesswork. > Before I do that, I wanted to check that it would be consumable by > Emacs. What works for you? Would it help to send the proposed GCC > patch to this bug address (or to the emacs-devel list?). I don't know how many people here build their own GCC, and thus could try the patch, but if sending the patch is not too much trouble, perhaps posting it on emacs-devel would be a good idea. If you do that, please cite this bug report, so that people who try that could respond here with their experience. > Alternatively, we already have a JSON output option (-fdiagnostics- > format=json); perhaps something like that could be used? Emacs can parse JSON. What are the pros and cons of the JSON alternative wrt to the text alternative? > Feature freeze for GCC 11 is about a month away; I'd love for Emacs to > be able to consume GCC fix-it hints (and have GCC and Emacs fix my > typos for me) Agreed; let's try to make that happen. Thanks.