[Bug fortran/53552] Add support for !GCC$ warning directive (cf. #pragma warning)

2014-04-16 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53552

Manuel López-Ibáñez manu at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #4 from Manuel López-Ibáñez manu at gcc dot gnu.org ---
After looking at the problem (see my comments and proof of concept patch in
PR44054), this is just a duplicate of that. All the features mentioned here and
there will be available at the same time.

*** This bug has been marked as a duplicate of bug 44054 ***

[Bug fortran/53552] Add support for !GCC$ warning directive (cf. #pragma warning)

2012-06-04 Thread burnus at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53552

Tobias Burnus burnus at gcc dot gnu.org changed:

   What|Removed |Added

 CC||burnus at gcc dot gnu.org

--- Comment #2 from Tobias Burnus burnus at gcc dot gnu.org 2012-06-04 
13:38:51 UTC ---
(In reply to comment #1)
 Wouldn't it be better to make Fortran use the common GCC diagnostics 
 machinery?

In some off-line discussion, Manuel wrote:
| diagnostics-core.h implements that core
| entry points. A FE needs to implement their own printf-like codes (see
| tree-diagnostics.c) and pretty-printer of expressions (similar to
| c-pretty-printer.c but for its own AST).

Regarding the multi-location support of gfortran:

| this is not implemented. But since the FEs need to handle
| their own format specifiers, it is a matter of interfacing your
| current implementation with the common diagnostics machinery.

| you could start by simply adding an interface to the current
| Fortran diagnostics machinery to access it from diagnostics.c. That
| is, implement enough glue code so you can call the current Fortran
| code passing through warning_at/error_at (or just re-wire gfc_warning
| to pass through diagnostic_report_diagnostic). This will give you
| #pragma GCC diagnostics, Werror=, and fdiagnostics-show-option almost
| for free.


I think as part of the implementation, one should pass to gfc_warning the flag
which triggers it (or 0 for default warning), similar to warning_at; example:
  warning_at (loc, OPT_Wcast_qual, ...

For hooking up front-end warnings, maybe java/lang.c can be of some help. Or
cp/error.c (esp. cp_print_error_function and cp_printer).


[Bug fortran/53552] Add support for !GCC$ warning directive (cf. #pragma warning)

2012-06-04 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53552

--- Comment #3 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-06-04 
14:03:03 UTC ---
(In reply to comment #2)
 
 I think as part of the implementation, one should pass to gfc_warning the flag
 which triggers it (or 0 for default warning), similar to warning_at; 
 example:
   warning_at (loc, OPT_Wcast_qual, ...

This is a must to fix this bug and PR44054, whether you wish to use the common
diagnostics code or not.

 For hooking up front-end warnings, maybe java/lang.c can be of some help. Or
 cp/error.c (esp. cp_print_error_function and cp_printer).

Note that you don't actually need to implement a pretty-printer to get this bug
and PR44054 fixed. The diagnostics.c code does not (if it does, it is a bug)
look into the string, you only need to fake a pretty-printer well enough that
calls the existing Fortran equivalent of a pretty-printer to process the
string.


[Bug fortran/53552] Add support for !GCC$ warning directive (cf. #pragma warning)

2012-06-01 Thread manu at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53552

Manuel López-Ibáñez manu at gcc dot gnu.org changed:

   What|Removed |Added

 CC||manu at gcc dot gnu.org

--- Comment #1 from Manuel López-Ibáñez manu at gcc dot gnu.org 2012-06-01 
18:40:44 UTC ---
Wouldn't it be better to make Fortran use the common GCC diagnostics machinery?
Now that there is caret information, what feature is missing? And you will also
fix PR44054. And there will be more code shared, which is a very good thing!