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 fortran/44054] Handle -Werror, -Werror=, -fdiagnostics-show-option
Date: Wed, 16 Apr 2014 19:59:00 -0000	[thread overview]
Message-ID: <bug-44054-4-gpDsnUb6Qk@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-44054-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44054

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
Created attachment 32622
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32622&action=edit
proof of concept

The attached patch is a proof of concept. It gives the following output:

/home/manuel/test1/test-gfc-warning.f03:11:0:
Warning: Possible change of value in conversion from INTEGER(8) to INTEGER(4)
at (1) [-Wconversion]
   arr = (/ INTEGER(KIND=4) :: HUGE(0_8) /) ! { dg-warning "conversion from" }
 ^

This warning is controllable by -Wno-conversion, -Werror=conversion and the
#pragma GCC diagnostic. Also the diagnostic is in color (unfortunately it does
not show it here).

Contrary to what I said above, I think it is actually easier for Fortran to use
the common pretty printer rather than fake their own. It will also remove quite
a bit of duplicated code from the Fortran FE. The transition can be done in the
following steps (I chose the wrong warning to start with):

1. Warnings that don't use %L (so initially you don't have to deal with locus)
2. Warnings that use %C
3. Warnings that use one %L
4. Warnings that use two %L


If there is one or more willing Fortran developers that wants to tackle this
for the next release, I think the four steps are feasible within one release.
To fully match the current Fortran diagnostics, the common diagnostics
machinery needs the following features:

a. Make the printing of the caret line more customizable. For the C/C++ FE it
will be moved to the diagnostic_finalizer, whereas for Fortran it will go in
the diagnostic_starter, so it can be printed before the actual text.
b. A way to customize the caret symbol so Fortran can print '1' instead of '^'.
c. Pass down offsets relative to current location. This is anyway necessary for
printing more precise diagnostics for format strings, so it is a matter to add
an offset field to the diagnostic_info structure.
d. A way to print two locations in the caret line.

And that is all as far as I can see.

If a Fortran developer volunteers to tackle the Fortran bits, I will be happy
to implement the common diagnostics bits. From the above a) and b) are trivial.
c) is also trivial but requires writing a bit more of code. d) is a bit more
convoluted but it should work fine.

The Fortran transition can be incremental, that is, if Fortran disables colors
and -fdiagnostics-show-option by default, then the converted diagnostics will
be indistinguishable from the unconverted ones (except that -Wno-*, -Werror=
and the #pragmas will only work for the converted ones).
>From gcc-bugs-return-449195-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Apr 16 20:05:59 2014
Return-Path: <gcc-bugs-return-449195-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25156 invoked by alias); 16 Apr 2014 20:05:59 -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 25123 invoked by uid 48); 16 Apr 2014 20:05:56 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60852] [4.8/4.9/4.10 Regression] boost::has_complement of enum class does not compile
Date: Wed, 16 Apr 2014 20:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: paolo.carlini at oracle dot com
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60852-4-Wum9UClui7@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60852-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60852-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: 2014-04/txt/msg01215.txt.bz2
Content-length: 287

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`852

--- Comment #15 from Marc Glisse <glisse at gcc dot gnu.org> ---
Did someone file a corresponding PR for clang? It is useful for them, but also
for gcc because it gives them a chance to give a different interpretation of
the standard.


       reply	other threads:[~2014-04-16 19:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-44054-4@http.gcc.gnu.org/bugzilla/>
2014-04-16 19:59 ` manu at gcc dot gnu.org [this message]
2014-04-21 15:19 ` [Bug fortran/44054] Handle -Werror, -Werror=, -fdiagnostics-show-option, !GCC$ diagnostic (pragmas) and color manu at gcc dot gnu.org
2014-04-30 23:01 ` manu at gcc dot gnu.org
2014-05-03  8:27 ` burnus at gcc dot gnu.org
2014-05-03  9:47 ` manu at gcc dot gnu.org
2014-08-15 15:11 ` manu at gcc dot gnu.org
2014-10-28 22:17 ` manu at gcc dot gnu.org
2014-11-11 22:51 ` manu at gcc dot gnu.org
2014-11-23 23:48 ` manu at gcc dot gnu.org
2014-12-11 15:14 ` manu at gcc dot gnu.org
2014-12-11 15:38 ` manu at gcc dot gnu.org
2014-12-11 16:31 ` burnus at gcc dot gnu.org
2015-05-16 12:30 ` manu at gcc dot gnu.org
2015-05-24 10:02 ` manu at gcc dot gnu.org
2010-05-10 10:21 [Bug fortran/44054] New: Handle -Werror, -Werror=, -fdiagnostics-show-option burnus at gcc dot gnu dot org
2010-05-10 10:31 ` [Bug fortran/44054] " burnus at gcc dot gnu dot org
2010-05-10 16:58 ` dfranke at gcc dot gnu dot org
2010-05-10 17:17 ` burnus at gcc dot gnu dot org
2010-05-15  0:44 ` manu at gcc dot gnu dot org

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-44054-4-gpDsnUb6Qk@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).