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).