mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
4851089fc6
commit
e74fe492f1
|
@ -1,3 +1,9 @@
|
||||||
|
2009-06-01 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
|
* diagnostic.c (diagnostic_build_prefix): Always print columns.
|
||||||
|
(diagnostic_report_current_module): Print columns.
|
||||||
|
* common.opt (flag_show_column): Enable by default.
|
||||||
|
|
||||||
2009-06-01 Luis Machado <luisgpm@br.ibm.com>
|
2009-06-01 Luis Machado <luisgpm@br.ibm.com>
|
||||||
|
|
||||||
* alias.c (find_base_term): Check for NULL term before returning.
|
* alias.c (find_base_term): Check for NULL term before returning.
|
||||||
|
|
|
@ -1049,8 +1049,8 @@ Common Report Var(flag_see) Init(0)
|
||||||
Eliminate redundant sign extensions using LCM.
|
Eliminate redundant sign extensions using LCM.
|
||||||
|
|
||||||
fshow-column
|
fshow-column
|
||||||
Common C ObjC C++ ObjC++ Report Var(flag_show_column) Init(0)
|
Common C ObjC C++ ObjC++ Report Var(flag_show_column) Init(1)
|
||||||
Show column numbers in diagnostics, when available. Default off
|
Show column numbers in diagnostics, when available. Default on
|
||||||
|
|
||||||
fsignaling-nans
|
fsignaling-nans
|
||||||
Common Report Var(flag_signaling_nans) Optimization
|
Common Report Var(flag_signaling_nans) Optimization
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2009-06-01 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
|
* error.c (print_instantiation_partial_context): Print column
|
||||||
|
numbers.
|
||||||
|
|
||||||
2009-05-29 Ian Lance Taylor <iant@google.com>
|
2009-05-29 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
* error.c (cp_printer): Don't use va_arg with enum type.
|
* error.c (cp_printer): Don't use va_arg with enum type.
|
||||||
|
|
|
@ -2705,19 +2705,30 @@ print_instantiation_partial_context (diagnostic_context *context,
|
||||||
struct tinst_level *t, location_t loc)
|
struct tinst_level *t, location_t loc)
|
||||||
{
|
{
|
||||||
expanded_location xloc;
|
expanded_location xloc;
|
||||||
|
const char *str;
|
||||||
for (; ; t = t->next)
|
for (; ; t = t->next)
|
||||||
{
|
{
|
||||||
xloc = expand_location (loc);
|
xloc = expand_location (loc);
|
||||||
if (t == NULL)
|
if (t == NULL)
|
||||||
break;
|
break;
|
||||||
pp_verbatim (context->printer, _("%s:%d: instantiated from %qs\n"),
|
str = decl_as_string_translate (t->decl,
|
||||||
xloc.file, xloc.line,
|
TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE);
|
||||||
decl_as_string_translate (t->decl,
|
if (flag_show_column)
|
||||||
TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE));
|
pp_verbatim (context->printer,
|
||||||
|
_("%s:%d:%d: instantiated from %qs\n"),
|
||||||
|
xloc.file, xloc.line, xloc.column, str);
|
||||||
|
else
|
||||||
|
pp_verbatim (context->printer,
|
||||||
|
_("%s:%d: instantiated from %qs\n"),
|
||||||
|
xloc.file, xloc.line, str);
|
||||||
loc = t->locus;
|
loc = t->locus;
|
||||||
}
|
}
|
||||||
pp_verbatim (context->printer, _("%s:%d: instantiated from here"),
|
if (flag_show_column)
|
||||||
xloc.file, xloc.line);
|
pp_verbatim (context->printer, _("%s:%d:%d: instantiated from here"),
|
||||||
|
xloc.file, xloc.line, xloc.column);
|
||||||
|
else
|
||||||
|
pp_verbatim (context->printer, _("%s:%d: instantiated from here"),
|
||||||
|
xloc.file, xloc.line);
|
||||||
pp_base_newline (context->printer);
|
pp_base_newline (context->printer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ diagnostic_build_prefix (diagnostic_info *diagnostic)
|
||||||
return
|
return
|
||||||
(s.file == NULL
|
(s.file == NULL
|
||||||
? build_message_string ("%s: %s", progname, text)
|
? 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:%d: %s", s.file, s.line, s.column, text)
|
||||||
: build_message_string ("%s:%d: %s", s.file, s.line, 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))
|
if (! MAIN_FILE_P (map))
|
||||||
{
|
{
|
||||||
map = INCLUDED_FROM (line_table, map);
|
map = INCLUDED_FROM (line_table, map);
|
||||||
pp_verbatim (context->printer,
|
if (flag_show_column)
|
||||||
"In file included from %s:%d",
|
pp_verbatim (context->printer,
|
||||||
map->to_file, LAST_SOURCE_LINE (map));
|
"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))
|
while (! MAIN_FILE_P (map))
|
||||||
{
|
{
|
||||||
map = INCLUDED_FROM (line_table, map);
|
map = INCLUDED_FROM (line_table, map);
|
||||||
|
|
|
@ -1,3 +1,46 @@
|
||||||
|
2009-06-01 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2009-06-01 Olivier Hainque <hainque@adacore.com>
|
2009-06-01 Olivier Hainque <hainque@adacore.com>
|
||||||
|
|
||||||
* gnat.dg/nested_float_packed.ads: New test.
|
* gnat.dg/nested_float_packed.ads: New test.
|
||||||
|
|
|
@ -5,8 +5,9 @@
|
||||||
/* { dg-error "unterminated comment" "" { target *-*-* } 4 } */
|
/* { dg-error "unterminated comment" "" { target *-*-* } 4 } */
|
||||||
/* { dg-error "unterminated comment" "header error" { target *-*-* } 8 } */
|
/* { dg-error "unterminated comment" "header error" { target *-*-* } 8 } */
|
||||||
|
|
||||||
#include "19940712-1.h" /* { dg-message "" } // In file included from: */
|
#include "19940712-1.h"
|
||||||
#include "19940712-1a.h" /* { dg-message "" } // In file included from: */
|
/* { dg-message "" "In file included from:" { target *-*-* } 0 } */
|
||||||
|
#include "19940712-1a.h"
|
||||||
#include "19940712-1b.h"
|
#include "19940712-1b.h"
|
||||||
|
|
||||||
/* comment start in comment error
|
/* comment start in comment error
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-std=gnu99 -I /jolly/well/better/not/exist -Wmissing-include-dirs -fno-show-column" } */
|
/* { dg-options "-std=gnu99 -I /jolly/well/better/not/exist -Wmissing-include-dirs" } */
|
||||||
|
|
||||||
/* Test that -Wmissing-include-dirs issues a warning when a specified
|
/* Test that -Wmissing-include-dirs issues a warning when a specified
|
||||||
directory does not exist. Source Ben Elliston, 2004-05-13. */
|
directory does not exist. Source Ben Elliston, 2004-05-13. */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-Wall -fshow-column" } */
|
/* { dg-options "-Wall" } */
|
||||||
|
|
||||||
/* Test that -Wall emits the warnings about integer promotion changing
|
/* Test that -Wall emits the warnings about integer promotion changing
|
||||||
the sign of an operand. */
|
the sign of an operand. */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-std=c99 -Wtrigraphs -fno-show-column" } */
|
/* { dg-options "-std=c99 -Wtrigraphs" } */
|
||||||
|
|
||||||
/* Test warnings for trigraphs in comments, with trigraphs enabled.
|
/* Test warnings for trigraphs in comments, with trigraphs enabled.
|
||||||
Neil Booth. 4 May 2003. */
|
Neil Booth. 4 May 2003. */
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-std=gnu99 -Wtrigraphs -fno-show-column" } */
|
/* { dg-options "-std=gnu99 -Wtrigraphs" } */
|
||||||
|
|
||||||
/* Test we don't double warn for trigraphs immediately after preceding
|
/* Test we don't double warn for trigraphs immediately after preceding
|
||||||
text. Source Neil Booth. 22 Nov 2000. */
|
text. Source Neil Booth. 22 Nov 2000. */
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
independent of target precision. */
|
independent of target precision. */
|
||||||
|
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options -fno-show-column } */
|
/* { dg-options "" } */
|
||||||
|
|
||||||
/* Test || operator and its short circuiting. */
|
/* Test || operator and its short circuiting. */
|
||||||
#if 0 || 0
|
#if 0 || 0
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
Please keep changes to arith-2.c and arith-3.c in sync. */
|
Please keep changes to arith-2.c and arith-3.c in sync. */
|
||||||
|
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-std=c99 -fno-show-column" } */
|
/* { dg-options "-std=c99" } */
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Malformed assertion tests. */
|
/* Malformed assertion tests. */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-fno-show-column -Wno-deprecated" } */
|
/* { dg-options "-Wno-deprecated" } */
|
||||||
|
|
||||||
#assert /* { dg-error "without predicate" "assert w/o predicate" } */
|
#assert /* { dg-error "without predicate" "assert w/o predicate" } */
|
||||||
#assert % /* { dg-error "an identifier" "assert punctuation" } */
|
#assert % /* { dg-error "an identifier" "assert punctuation" } */
|
||||||
|
|
|
@ -37,7 +37,7 @@ dg-init
|
||||||
|
|
||||||
# Main loop.
|
# Main loop.
|
||||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.{c,S} ]] \
|
||||||
"-fno-show-column" $DEFAULT_CFLAGS
|
"" $DEFAULT_CFLAGS
|
||||||
|
|
||||||
# All done.
|
# All done.
|
||||||
dg-finish
|
dg-finish
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright (C) 2001 Free Software Foundation, Inc. */
|
/* Copyright (C) 2001 Free Software Foundation, Inc. */
|
||||||
|
|
||||||
/* { dg-do compile } */
|
/* { dg-do compile } */
|
||||||
/* { dg-options "-pedantic -std=c99 -fno-show-column" } */
|
/* { dg-options "-pedantic -std=c99" } */
|
||||||
|
|
||||||
/* This tests various diagnostics with -pedantic about escape
|
/* This tests various diagnostics with -pedantic about escape
|
||||||
sequences, for both the preprocessor and the compiler.
|
sequences, for both the preprocessor and the compiler.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright (C) 2001 Free Software Foundation, Inc. */
|
/* Copyright (C) 2001 Free Software Foundation, Inc. */
|
||||||
|
|
||||||
/* { dg-do compile } */
|
/* { dg-do compile } */
|
||||||
/* { dg-options "-Wtraditional -std=c89 -fno-show-column" } */
|
/* { dg-options "-Wtraditional -std=c89" } */
|
||||||
|
|
||||||
/* This tests various diagnostics with -Wtraditioanl about escape
|
/* This tests various diagnostics with -Wtraditioanl about escape
|
||||||
sequences, for both the preprocessor and the compiler.
|
sequences, for both the preprocessor and the compiler.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */
|
/* Copyright (C) 2000, 2008 Free Software Foundation, Inc. */
|
||||||
|
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-fno-show-column -Wno-deprecated" } */
|
/* { dg-options "-Wno-deprecated" } */
|
||||||
|
|
||||||
/* Tests all directives that do not permit excess tokens at the end of
|
/* Tests all directives that do not permit excess tokens at the end of
|
||||||
the line. */
|
the line. */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright (C) 2002 Free Software Foundation, Inc. */
|
/* Copyright (C) 2002 Free Software Foundation, Inc. */
|
||||||
|
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-fno-show-column -Wno-endif-labels" } */
|
/* { dg-options "-Wno-endif-labels" } */
|
||||||
|
|
||||||
/* Tests that -Wno-endif-labels correctly disables the checks done by
|
/* Tests that -Wno-endif-labels correctly disables the checks done by
|
||||||
default (and tested in extratokens.c). */
|
default (and tested in extratokens.c). */
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
missing parenthesis message. */
|
missing parenthesis message. */
|
||||||
|
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-fshow-column" } */
|
|
||||||
#if (1 /* { dg-error "5:missing '\\)'" "missing ')' no. 1" } */
|
#if (1 /* { dg-error "5:missing '\\)'" "missing ')' no. 1" } */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -11,5 +11,5 @@
|
||||||
|
|
||||||
/* These error is No such file or directory, just once. However, this
|
/* These error is No such file or directory, just once. However, this
|
||||||
message is locale-dependent, so don't test for it. */
|
message is locale-dependent, so don't test for it. */
|
||||||
/* { dg-error "silly" "" { target *-*-* } 10 } */
|
/* { dg-error "silly" "" { target *-*-* } 0 } */
|
||||||
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
|
|
||||||
/* These error is No such file or directory, just once. However, this
|
/* These error is No such file or directory, just once. However, this
|
||||||
message is locale-dependent, so don't test for it. */
|
message is locale-dependent, so don't test for it. */
|
||||||
/* { dg-error "silly" "" { target *-*-* } 10 } */
|
/* { dg-error "silly" "" { target *-*-* } 0 } */
|
||||||
/* { dg-error "missing" "" { target *-*-* } 10 } */
|
/* { dg-error "missing" "" { target *-*-* } 0 } */
|
||||||
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* PR preprocessor/19475 */
|
/* PR preprocessor/19475 */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-std=iso9899:1990 -pedantic-errors -fno-show-column" } */
|
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
|
||||||
|
|
||||||
#define a! /* { dg-warning "missing whitespace" } */
|
#define a! /* { dg-warning "missing whitespace" } */
|
||||||
#define b" /* { dg-warning "missing whitespace" } */
|
#define b" /* { dg-warning "missing whitespace" } */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* PR preprocessor/19475 */
|
/* PR preprocessor/19475 */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-std=iso9899:1999 -pedantic-errors -fno-show-column" } */
|
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
|
||||||
|
|
||||||
#define a! /* { dg-error "requires whitespace" } */
|
#define a! /* { dg-error "requires whitespace" } */
|
||||||
#define b" /* { dg-error "requires whitespace" } */
|
#define b" /* { dg-error "requires whitespace" } */
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
/* { dg-do compile } */
|
/* { dg-do compile } */
|
||||||
/* { dg-options "" } */
|
/* { dg-options "" } */
|
||||||
|
|
||||||
#include "nonexistent.h" /* { dg-error "nonexistent.h" } */
|
#include "nonexistent.h"
|
||||||
|
/* { dg-message "nonexistent.h" "" { target *-*-* } 0 } */
|
||||||
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
||||||
|
|
||||||
/* This declaration should not receive any diagnostic. */
|
/* This declaration should not receive any diagnostic. */
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/* { dg-do preprocess }
|
/* { dg-do preprocess } */
|
||||||
{ dg-options "-fno-show-column" } */
|
|
||||||
|
|
||||||
#pragma GCC poison foo
|
#pragma GCC poison foo
|
||||||
foo /* { dg-error "foo" "use of foo" } */
|
foo /* { dg-error "foo" "use of foo" } */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* PR preprocessor/29612 */
|
/* PR preprocessor/29612 */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-Wtraditional -fno-show-column" } */
|
/* { dg-options "-Wtraditional" } */
|
||||||
|
|
||||||
# 6 "pr29612-2.c"
|
# 6 "pr29612-2.c"
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Test for redefining macros with significant differences. */
|
/* Test for redefining macros with significant differences. */
|
||||||
|
|
||||||
/* { dg-do preprocess }
|
/* { dg-do preprocess }
|
||||||
{ dg-options "-ansi -Wall -fno-show-column" } */
|
{ dg-options "-ansi -Wall" } */
|
||||||
|
|
||||||
#define mac(a, b) (a) + (b)
|
#define mac(a, b) (a) + (b)
|
||||||
#define mac(a, b) (a) * (b)
|
#define mac(a, b) (a) * (b)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright (C) 2000 Free Software Foundation, Inc. */
|
/* Copyright (C) 2000 Free Software Foundation, Inc. */
|
||||||
|
|
||||||
/* { dg-do run } */
|
/* { dg-do run } */
|
||||||
/* { dg-options "-std=c99 -pedantic-errors -fno-show-column" } */
|
/* { dg-options "-std=c99 -pedantic-errors" } */
|
||||||
|
|
||||||
/* Tests a whole bunch of things are correctly stringified. */
|
/* Tests a whole bunch of things are correctly stringified. */
|
||||||
|
|
||||||
|
|
|
@ -8,5 +8,6 @@
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-error "include_next" "good error" { target *-*-* } 4 } */
|
/* { dg-error "include_next" "good error" { target *-*-* } 4 } */
|
||||||
|
|
||||||
#include "syshdr1.h" /* { dg-message "" "In file included from:" } */
|
#include "syshdr1.h"
|
||||||
|
/* { dg-message "" "In file included from:" { target *-*-* } 0 } */
|
||||||
#include "syshdr2.h"
|
#include "syshdr2.h"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* Copyright (C) 2001 Free Software Foundation, Inc. */
|
/* Copyright (C) 2001 Free Software Foundation, Inc. */
|
||||||
|
|
||||||
/* { dg-do compile } */
|
/* { dg-do compile } */
|
||||||
/* { dg-options "-std=gnu99 -pedantic -Wtraditional -fno-show-column" } */
|
/* { dg-options "-std=gnu99 -pedantic -Wtraditional" } */
|
||||||
|
|
||||||
/* Tests diagnostics are suppressed for some macros defined in system
|
/* Tests diagnostics are suppressed for some macros defined in system
|
||||||
headers. */
|
headers. */
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Test for warnings about nontraditional directives. */
|
/* Test for warnings about nontraditional directives. */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-pedantic -Wtraditional -fno-show-column" } */
|
/* { dg-options "-pedantic -Wtraditional" } */
|
||||||
|
|
||||||
/* Block 1: K+R directives should have the # indented. */
|
/* Block 1: K+R directives should have the # indented. */
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
warnings inside unused clauses because they are often hidden this
|
warnings inside unused clauses because they are often hidden this
|
||||||
way on purpose. However they do still require indentation for K&R. */
|
way on purpose. However they do still require indentation for K&R. */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-pedantic -Wtraditional -fno-show-column" } */
|
/* { dg-options "-pedantic -Wtraditional" } */
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Note, gcc should omit these warnings in system header files.
|
Note, gcc should omit these warnings in system header files.
|
||||||
By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
|
By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-Wtraditional -fno-show-column" } */
|
/* { dg-options "-Wtraditional" } */
|
||||||
|
|
||||||
#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
|
#if 1U /* { dg-warning "traditional C rejects" "numeric constant suffix" } */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Note, gcc should omit these warnings in system header files.
|
Note, gcc should omit these warnings in system header files.
|
||||||
By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
|
By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000. */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-Wtraditional -fno-show-column" } */
|
/* { dg-options "-Wtraditional" } */
|
||||||
|
|
||||||
#if +1 /* { dg-warning "unary plus operator" "unary plus operator" } */
|
#if +1 /* { dg-warning "unary plus operator" "unary plus operator" } */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
Note, gcc should omit these warnings in system header files.
|
Note, gcc should omit these warnings in system header files.
|
||||||
By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 9/8/2000. */
|
By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 9/8/2000. */
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-Wtraditional -fno-show-column" } */
|
/* { dg-options "-Wtraditional" } */
|
||||||
|
|
||||||
#define foo1(h) sdf "h3" fds "h" /* { dg-warning "macro argument \"h\" would be stringified" "traditional stringification" } */
|
#define foo1(h) sdf "h3" fds "h" /* { dg-warning "macro argument \"h\" would be stringified" "traditional stringification" } */
|
||||||
#define foo2(h2) sdf "h2" fds "h3" /* { dg-warning "macro argument \"h2\" would be stringified" "traditional stringification" } */
|
#define foo2(h2) sdf "h2" fds "h3" /* { dg-warning "macro argument \"h2\" would be stringified" "traditional stringification" } */
|
||||||
|
|
|
@ -37,7 +37,7 @@ dg-init
|
||||||
|
|
||||||
# Main loop.
|
# Main loop.
|
||||||
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
|
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \
|
||||||
"-fno-show-column" $DEFAULT_TRADCPPFLAGS
|
"" $DEFAULT_TRADCPPFLAGS
|
||||||
|
|
||||||
# All done.
|
# All done.
|
||||||
dg-finish
|
dg-finish
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-fno-show-column" } */
|
|
||||||
|
|
||||||
/* Tests for un-terminated conditional diagnostics.
|
/* Tests for un-terminated conditional diagnostics.
|
||||||
Copyright (c) 1999 Free Software Foundation.
|
Copyright (c) 1999 Free Software Foundation.
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
/* C99 6.10.8 para 4: None of [the predefined macro names] shall be
|
/* C99 6.10.8 para 4: None of [the predefined macro names] shall be
|
||||||
the subject of a #define or an #undef preprocessing directive. We
|
the subject of a #define or an #undef preprocessing directive. */
|
||||||
pass -fno-show-column as otherwise dejagnu gets confused. */
|
|
||||||
|
|
||||||
/* { dg-do preprocess } */
|
/* { dg-do preprocess } */
|
||||||
/* { dg-options "-fno-show-column" } */
|
|
||||||
|
|
||||||
#undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */
|
#undef __DATE__ /* { dg-warning "undefining" "__DATE__" } */
|
||||||
#undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */
|
#undef __TIME__ /* { dg-warning "undefining" "__TIME__" } */
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */
|
#include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */
|
||||||
/* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 10 } */
|
/* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 0 } */
|
||||||
/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */
|
/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */
|
||||||
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/* { dg-options "-I. -Winvalid-pch -g" } */
|
/* { dg-options "-I. -Winvalid-pch -g" } */
|
||||||
|
|
||||||
#include "valid-1.h"/* { dg-warning "created with -gnone, but used with -g" } */
|
#include "valid-1.h"/* { dg-warning "created with -gnone, but used with -g" } */
|
||||||
/* { dg-error "No such file" "no such file" { target *-*-* } 3 } */
|
/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */
|
||||||
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */
|
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */
|
||||||
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/* { dg-options "-I. -Winvalid-pch -fexceptions" } */
|
/* { dg-options "-I. -Winvalid-pch -fexceptions" } */
|
||||||
|
|
||||||
#include "valid-2.h" /* { dg-warning "settings for -fexceptions do not match" } */
|
#include "valid-2.h" /* { dg-warning "settings for -fexceptions do not match" } */
|
||||||
/* { dg-error "No such file" "no such file" { target *-*-* } 3 } */
|
/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */
|
||||||
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */
|
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */
|
||||||
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
||||||
int x;
|
int x;
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
#define DEFINED_VALUE 3
|
#define DEFINED_VALUE 3
|
||||||
|
|
||||||
#include "warn-1.h"/* { dg-warning "not used because .DEFINED_VALUE. is defined" } */
|
#include "warn-1.h"/* { dg-warning "not used because .DEFINED_VALUE. is defined" } */
|
||||||
/* { dg-error "No such file" "no such file" { target *-*-* } 5 } */
|
/* { dg-error "No such file" "no such file" { target *-*-* } 0 } */
|
||||||
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 5 } */
|
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 0 } */
|
||||||
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
/* { dg-message "terminated" "" { target *-*-* } 0 } */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
#include <varargs.h> /* { dg-bogus "varargs.h" "missing file" } */
|
#include <varargs.h> /* { dg-bogus "varargs.h" "missing file" } */
|
||||||
|
|
||||||
/* { dg-message "" "In file included from" { target *-*-* } 6 } */
|
/* { dg-message "file included from" "file included from" { target *-*-* } 0 } */
|
||||||
/* { dg-error "no longer implements" "#error 1" { target *-*-* } 4 } */
|
/* { dg-error "no longer implements" "#error 1" { target *-*-* } 4 } */
|
||||||
/* { dg-error "Revise your code" "#error 2" { target *-*-* } 5 } */
|
/* { dg-error "Revise your code" "#error 2" { target *-*-* } 5 } */
|
||||||
|
|
||||||
|
|
|
@ -620,6 +620,17 @@ if { [info procs saved-dg-error] == [list] \
|
||||||
|
|
||||||
process-message saved-dg-error "$gcc_error_prefix" "$args"
|
process-message saved-dg-error "$gcc_error_prefix" "$args"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Override dg-bogus at the same time. It doesn't handle a prefix
|
||||||
|
# but its expression should include a column number. Otherwise the
|
||||||
|
# line number can match the column number for other messages, leading
|
||||||
|
# to insanity.
|
||||||
|
rename dg-bogus saved-dg-bogus
|
||||||
|
|
||||||
|
proc dg-bogus { args } {
|
||||||
|
upvar dg-messages dg-messages
|
||||||
|
process-message saved-dg-bogus "" $args
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Modify the regular expression saved by a DejaGnu message directive to
|
# Modify the regular expression saved by a DejaGnu message directive to
|
||||||
|
@ -641,20 +652,26 @@ proc process-message { msgproc msgprefix dgargs } {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prepend the message prefix to the regular expression and make
|
# Get the entry for the new message. Prepend the message prefix to
|
||||||
# it match a single line.
|
# the regular expression and make it match a single line.
|
||||||
set newentry [lindex ${dg-messages} end]
|
set newentry [lindex ${dg-messages} end]
|
||||||
set expmsg [lindex $newentry 2]
|
set expmsg [lindex $newentry 2]
|
||||||
|
|
||||||
# If we have a column...
|
# Handle column numbers from the specified expression (if there is
|
||||||
|
# one) and set up the search expression that will be used by DejaGnu.
|
||||||
if [regexp "^(\[0-9\]+):" $expmsg "" column] {
|
if [regexp "^(\[0-9\]+):" $expmsg "" column] {
|
||||||
# Remove "COLUMN:"
|
# The expression in the directive included a column number.
|
||||||
|
# Remove "COLUMN:" from the original expression and move it
|
||||||
|
# to the proper place in the search expression.
|
||||||
regsub "^\[0-9\]+:" $expmsg "" expmsg
|
regsub "^\[0-9\]+:" $expmsg "" expmsg
|
||||||
|
set expmsg "$column: $msgprefix\[^\n\]*$expmsg"
|
||||||
# Include the column in the search expression.
|
} elseif [string match "" [lindex $newentry 0]] {
|
||||||
set expmsg "$column: $msgprefix\[^\n]*$expmsg"
|
# The specified line number is 0; don't expect a column number.
|
||||||
|
set expmsg "$msgprefix\[^\n\]*$expmsg"
|
||||||
} else {
|
} else {
|
||||||
set expmsg "$msgprefix\[^\n]*$expmsg"
|
# There is no column number in the search expression, but we
|
||||||
|
# should expect one in the message itself.
|
||||||
|
set expmsg "\[0-9\]+: $msgprefix\[^\n\]*$expmsg"
|
||||||
}
|
}
|
||||||
|
|
||||||
set newentry [lreplace $newentry 2 2 $expmsg]
|
set newentry [lreplace $newentry 2 2 $expmsg]
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2009-06-01 Aldy Hernandez <aldyh@redhat.com>
|
||||||
|
|
||||||
|
* include/line-map.h (LAST_SOURCE_COLUMN): New.
|
||||||
|
|
||||||
2009-06-01 Ian Lance Taylor <iant@google.com>
|
2009-06-01 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
* include/cpp-id-data.h: Add extern "C".
|
* include/cpp-id-data.h: Add extern "C".
|
||||||
|
|
|
@ -158,6 +158,8 @@ extern const struct line_map *linemap_lookup
|
||||||
of the #include, or other directive, that caused a map change. */
|
of the #include, or other directive, that caused a map change. */
|
||||||
#define LAST_SOURCE_LINE(MAP) \
|
#define LAST_SOURCE_LINE(MAP) \
|
||||||
SOURCE_LINE (MAP, LAST_SOURCE_LINE_LOCATION (MAP))
|
SOURCE_LINE (MAP, LAST_SOURCE_LINE_LOCATION (MAP))
|
||||||
|
#define LAST_SOURCE_COLUMN(MAP) \
|
||||||
|
SOURCE_COLUMN (MAP, LAST_SOURCE_LINE_LOCATION (MAP))
|
||||||
#define LAST_SOURCE_LINE_LOCATION(MAP) \
|
#define LAST_SOURCE_LINE_LOCATION(MAP) \
|
||||||
((((MAP)[1].start_location - 1 - (MAP)->start_location) \
|
((((MAP)[1].start_location - 1 - (MAP)->start_location) \
|
||||||
& ~((1 << (MAP)->column_bits) - 1)) \
|
& ~((1 << (MAP)->column_bits) - 1)) \
|
||||||
|
|
Loading…
Reference in New Issue