aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2009-06-01 16:09:33 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2009-06-01 16:09:33 +0000
commite74fe492f19c8a2bdf1077af1583c74a5ecd7c98 (patch)
tree79bf383cc2d2a276e12de3fa9beabb03ba047e66 /gcc/diagnostic.c
parent4851089fc69c0a249ff82f307829b47dc3856ee0 (diff)
downloadgcc-e74fe492f19c8a2bdf1077af1583c74a5ecd7c98.zip
gcc-e74fe492f19c8a2bdf1077af1583c74a5ecd7c98.tar.gz
gcc-e74fe492f19c8a2bdf1077af1583c74a5ecd7c98.tar.bz2
diagnostic.c (diagnostic_build_prefix): Always print columns.
gcc/ * diagnostic.c (diagnostic_build_prefix): Always print columns. (diagnostic_report_current_module): Print columns. * common.opt (flag_show_column): Enable by default. gcc/testsuite/ * lib/gcc-dg.exp (dg-bogus): Override dg-bogus. (process-message): Expect column numbers. * gcc.dg/va-arg-2.c: Use line 0 to indicate no column. * gcc.dg/pch/counter-2.c: Same. * gcc.dg/pch/valid-2.c: Same. * gcc.dg/pch/warn-1.c: Same. * gcc.dg/pch/valid-1.c: Same. * gcc.dg/cpp/include2a.c: Handle lack of columns. * gcc.dg/cpp/syshdr.c: Same. * gcc.dg/cpp/19940712-1.c: Same. * gcc.dg/cpp/missing-header-1.c: Same. * gcc.dg/cpp/unc4.c: Remove -fno-show-column. * gcc.dg/cpp/tr-warn3.c: Same. * gcc.dg/cpp/pr29612-2.c: Same. * gcc.dg/cpp/tr-warn4.c: Same. * gcc.dg/cpp/Wtrigraphs.c: Same. * gcc.dg/cpp/poison.c: Same. * gcc.dg/cpp/arith-3.c: Same. * gcc.dg/cpp/sysmac2.c: Same. * gcc.dg/cpp/cpp.exp: Same. * gcc.dg/cpp/tr-warn5.c: Same. * gcc.dg/cpp/include2.c: Same. * gcc.dg/cpp/Wmissingdirs.c: Same. * gcc.dg/cpp/Wmissingdirs.c: Same. * gcc.dg/cpp/tr-warn6.c: Same. * gcc.dg/cpp/Wtrigraphs-2.c: Same. * gcc.dg/cpp/macspace1.c: Same. * gcc.dg/cpp/escape-2.c: Same. * gcc.dg/cpp/assert2.c: Same. * gcc.dg/cpp/undef2.c: Same. * gcc.dg/cpp/macspace2.c: Same. * gcc.dg/cpp/tr-warn1.c: Same. * gcc.dg/cpp/extratokens2.c: Same. * gcc.dg/cpp/strify2.c: Same. * gcc.dg/cpp/Wsignprom.c: Same. * gcc.dg/cpp/redef2.c: Same. * gcc.dg/cpp/trad/trad.exp: Same. * gcc.dg/cpp/arith-1.c: Same. * gcc.dg/cpp/extratokens.c: Same. * gcc.dg/cpp/if-mpar.c: Same. gcc/cp/ * error.c (print_instantiation_partial_context): Print column numbers. libcpp/ * include/line-map.h (LAST_SOURCE_COLUMN): New. From-SVN: r148052
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 42a40c6f..3f7bab1 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -162,7 +162,7 @@ diagnostic_build_prefix (diagnostic_info *diagnostic)
return
(s.file == NULL
? build_message_string ("%s: %s", progname, text)
- : flag_show_column && s.column != 0
+ : flag_show_column
? build_message_string ("%s:%d:%d: %s", s.file, s.line, s.column, text)
: build_message_string ("%s:%d: %s", s.file, s.line, text));
}
@@ -244,9 +244,15 @@ diagnostic_report_current_module (diagnostic_context *context)
if (! MAIN_FILE_P (map))
{
map = INCLUDED_FROM (line_table, map);
- pp_verbatim (context->printer,
- "In file included from %s:%d",
- map->to_file, LAST_SOURCE_LINE (map));
+ if (flag_show_column)
+ pp_verbatim (context->printer,
+ "In file included from %s:%d:%d",
+ map->to_file,
+ LAST_SOURCE_LINE (map), LAST_SOURCE_COLUMN (map));
+ else
+ pp_verbatim (context->printer,
+ "In file included from %s:%d",
+ map->to_file, LAST_SOURCE_LINE (map));
while (! MAIN_FILE_P (map))
{
map = INCLUDED_FROM (line_table, map);