diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 25 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/c-common.c | 65 | ||||
-rw-r--r-- | gcc/c-common.h | 5 | ||||
-rw-r--r-- | gcc/c-decl.c | 2 | ||||
-rw-r--r-- | gcc/c-opts.c | 25 | ||||
-rw-r--r-- | gcc/c-ppoutput.c | 3 | ||||
-rw-r--r-- | gcc/c-tree.h | 4 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 3 | ||||
-rw-r--r-- | gcc/cp/error.c | 33 | ||||
-rw-r--r-- | gcc/cp/parser.c | 3 | ||||
-rw-r--r-- | gcc/diagnostic.c | 7 | ||||
-rw-r--r-- | gcc/diagnostic.h | 7 | ||||
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/cpp.c | 58 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/builtin-redefine.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c | 1 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/redef2.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/redef3.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/trad/redef2.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/fltconst-1.c | 2 |
24 files changed, 223 insertions, 89 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 37bab5e..5f2d8ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,28 @@ +2009-03-29 Joseph Myers <joseph@codesourcery.com> + + PR preprocessor/34695 + * Makefile.in (c-opts.o): Depend on c-tree.h. + * c-common.c: Move down include of diagnostic.h. + (done_lexing, c_cpp_error): New. + * c-common.h (done_lexing): Declare. + * c-decl.c (c_write_global_declarations): Don't check cpp_errors + (parse_in). + * c-opts.c: Include c-tree.h. + (c_common_init_options): Set preprocessor error callback. + (c_common_handle_option): Do not set preprocessor + inhibit_warnings, warnings_are_errors, warn_system_headers, + pedantic_errors or inhibit_warnings flags. + (c_common_post_options): Do not check cpp_errors (parse_in). + (c_common_finish): Do not output dependencies if there were + errors. Do not check return value of cpp_finish. + * c-ppoutput.c (pp_file_change): Set input_location. + * c-tree.h (c_cpp_error): Declare. + * diagnostic.c (diagnostic_set_info_translated): Also initialize + override_column. + (diagnostic_build_prefix): Check override_column. + * diagnostic.h (diagnostic_info): Add override_column field. + (diagnostic_override_column): Define. + 2009-03-28 Paolo Bonzini <bonzini@gnu.org> * c-common.c (c_expand_expr, c_staticp): Remove. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 7464d3e..d01fa3a 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1889,7 +1889,7 @@ c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ $(TREE_H) $(C_PRAGMA_H) $(FLAGS_H) $(TOPLEV_H) langhooks.h \ $(TREE_INLINE_H) $(DIAGNOSTIC_H) intl.h debug.h $(C_COMMON_H) \ opts.h options.h $(MKDEPS_H) incpath.h cppdefault.h $(TARGET_H) \ - $(TM_P_H) $(VARRAY_H) + $(TM_P_H) $(VARRAY_H) $(C_TREE_H) $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ $< $(OUTPUT_OPTION) @TARGET_SYSTEM_ROOT_DEFINE@ diff --git a/gcc/c-common.c b/gcc/c-common.c index 8450cc9..9abd006 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -33,7 +33,6 @@ along with GCC; see the file COPYING3. If not see #include "varray.h" #include "expr.h" #include "c-common.h" -#include "diagnostic.h" #include "tm_p.h" #include "obstack.h" #include "cpplib.h" @@ -42,6 +41,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-inline.h" #include "c-tree.h" #include "toplev.h" +#include "diagnostic.h" #include "tree-iterator.h" #include "hashtab.h" #include "tree-mudflap.h" @@ -497,6 +497,10 @@ tree (*make_fname_decl) (tree, int); This is a count, since unevaluated expressions can nest. */ int skip_evaluation; +/* Whether lexing has been completed, so subsequent preprocessor + errors should use the compiler's input_location. */ +bool done_lexing = false; + /* Information about how a function name is generated. */ struct fname_var_t { @@ -7928,6 +7932,65 @@ c_parse_error (const char *gmsgid, enum cpp_ttype token, tree value) #undef catenate_messages } +/* Callback from cpp_error for PFILE to print diagnostics from the + preprocessor. The diagnostic is of type LEVEL, at location + LOCATION unless this is after lexing and the compiler's location + should be used instead, with column number possibly overridden by + COLUMN_OVERRIDE if not zero; MSG is the translated message and AP + the arguments. Returns true if a diagnostic was emitted, false + otherwise. */ + +bool +c_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, + location_t location, unsigned int column_override, + const char *msg, va_list *ap) +{ + diagnostic_info diagnostic; + diagnostic_t dlevel; + int save_warn_system_headers = warn_system_headers; + bool ret; + + switch (level) + { + case CPP_DL_WARNING_SYSHDR: + if (flag_no_output) + return false; + warn_system_headers = 1; + /* Fall through. */ + case CPP_DL_WARNING: + if (flag_no_output) + return false; + dlevel = DK_WARNING; + break; + case CPP_DL_PEDWARN: + if (flag_no_output && !flag_pedantic_errors) + return false; + dlevel = DK_PEDWARN; + break; + case CPP_DL_ERROR: + dlevel = DK_ERROR; + break; + case CPP_DL_ICE: + dlevel = DK_ICE; + break; + case CPP_DL_NOTE: + dlevel = DK_NOTE; + break; + default: + gcc_unreachable (); + } + if (done_lexing) + location = input_location; + diagnostic_set_info_translated (&diagnostic, msg, ap, + location, dlevel); + if (column_override) + diagnostic_override_column (&diagnostic, column_override); + ret = report_diagnostic (&diagnostic); + if (level == CPP_DL_WARNING_SYSHDR) + warn_system_headers = save_warn_system_headers; + return ret; +} + /* Walk a gimplified function and warn for functions whose return value is ignored and attribute((warn_unused_result)) is set. This is done before inlining, so we don't have to worry about that. */ diff --git a/gcc/c-common.h b/gcc/c-common.h index 6b5fb94..642769d 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -660,6 +660,11 @@ extern int max_tinst_depth; extern int skip_evaluation; +/* Whether lexing has been completed, so subsequent preprocessor + errors should use the compiler's input_location. */ + +extern bool done_lexing; + /* C types are partitioned into three subsets: object, function, and incomplete types. */ #define C_TYPE_OBJECT_P(type) \ diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 588b75c..97d95b8 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -8148,7 +8148,7 @@ c_write_global_declarations (void) /* Don't waste time on further processing if -fsyntax-only or we've encountered errors. */ - if (flag_syntax_only || errorcount || sorrycount || cpp_errors (parse_in)) + if (flag_syntax_only || errorcount || sorrycount) return; /* Close the external scope. */ diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 28bdc31..334577a 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -40,6 +40,7 @@ along with GCC; see the file COPYING3. If not see #include "mkdeps.h" #include "target.h" #include "tm_p.h" +#include "c-tree.h" /* For c_cpp_error. */ #ifndef DOLLARS_IN_IDENTIFIERS # define DOLLARS_IN_IDENTIFIERS true @@ -201,6 +202,7 @@ c_common_init_options (unsigned int argc, const char **argv) { static const unsigned int lang_flags[] = {CL_C, CL_ObjC, CL_CXX, CL_ObjCXX}; unsigned int i, result; + struct cpp_callbacks *cb; /* This is conditionalized only because that is the way the front ends used to do it. Maybe this should be unconditional? */ @@ -216,6 +218,8 @@ c_common_init_options (unsigned int argc, const char **argv) parse_in = cpp_create_reader (c_dialect_cxx () ? CLK_GNUCXX: CLK_GNUC89, ident_hash, line_table); + cb = cpp_get_callbacks (parse_in); + cb->error = c_cpp_error; cpp_opts = cpp_get_options (parse_in); cpp_opts->dollars_in_ident = DOLLARS_IN_IDENTIFIERS; @@ -333,7 +337,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) or environment var dependency generation is used. */ cpp_opts->deps.style = (code == OPT_M ? DEPS_SYSTEM: DEPS_USER); flag_no_output = 1; - cpp_opts->inhibit_warnings = 1; break; case OPT_MD: @@ -444,7 +447,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) break; case OPT_Werror: - cpp_opts->warnings_are_errors = value; global_dc->warning_as_error_requested = value; break; @@ -503,10 +505,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) warn_strict_null_sentinel = value; break; - case OPT_Wsystem_headers: - cpp_opts->warn_system_headers = value; - break; - case OPT_Wtraditional: cpp_opts->warn_traditional = value; break; @@ -895,8 +893,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) c_common_post_options, so that a subsequent -Wno-endif-labels is not overridden. */ case OPT_pedantic_errors: - cpp_opts->pedantic_errors = 1; - /* Fall through. */ case OPT_pedantic: cpp_opts->pedantic = 1; cpp_opts->warn_endif_labels = 1; @@ -971,10 +967,6 @@ c_common_handle_option (size_t scode, const char *arg, int value) flag_undef = 1; break; - case OPT_w: - cpp_opts->inhibit_warnings = 1; - break; - case OPT_v: verbose = true; break; @@ -1159,10 +1151,6 @@ c_common_post_options (const char **pfilename) input_location = UNKNOWN_LOCATION; - /* If an error has occurred in cpplib, note it so we fail - immediately. */ - errorcount += cpp_errors (parse_in); - *pfilename = this_input_filename = cpp_read_main_file (parse_in, in_fnames[0]); /* Don't do any compilation or preprocessing if there is no input file. */ @@ -1274,7 +1262,8 @@ c_common_finish (void) { FILE *deps_stream = NULL; - if (cpp_opts->deps.style != DEPS_NONE) + /* Don't write the deps file if there are errors. */ + if (cpp_opts->deps.style != DEPS_NONE && errorcount == 0) { /* If -M or -MM was seen without -MF, default output to the output stream. */ @@ -1290,7 +1279,7 @@ c_common_finish (void) /* For performance, avoid tearing down cpplib's internal structures with cpp_destroy (). */ - errorcount += cpp_finish (parse_in, deps_stream); + cpp_finish (parse_in, deps_stream); if (deps_stream && deps_stream != out_stream && (ferror (deps_stream) || fclose (deps_stream))) diff --git a/gcc/c-ppoutput.c b/gcc/c-ppoutput.c index f5a3a78..ff3e6b6 100644 --- a/gcc/c-ppoutput.c +++ b/gcc/c-ppoutput.c @@ -1,6 +1,6 @@ /* Preprocess only, using cpplib. Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007, - 2008 Free Software Foundation, Inc. + 2008, 2009 Free Software Foundation, Inc. Written by Per Bothner, 1994-95. This program is free software; you can redistribute it and/or modify it @@ -521,6 +521,7 @@ pp_file_change (const struct line_map *map) if (map != NULL) { + input_location = map->start_location; if (print.first_time) { /* Avoid printing foo.i when the main file is foo.c. */ diff --git a/gcc/c-tree.h b/gcc/c-tree.h index f9e4b3e..ac9586b 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -672,4 +672,8 @@ extern void c_write_global_declarations (void); extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4); extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_CDIAG(3,4); +extern bool c_cpp_error (cpp_reader *, int, location_t, unsigned int, + const char *, va_list *) + ATTRIBUTE_GCC_CDIAG(5,0); + #endif /* ! GCC_C_TREE_H */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5bcd13e..5401141 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2009-03-29 Joseph Myers <joseph@codesourcery.com> + + PR preprocessor/34695 + * cp-tree.h (cp_cpp_error): Remove. + * error.c (cp_cpp_error): Remove. + * parser.c (cp_lexer_new_main): Set done_lexing instead of + client_diagnostic and error callback. + 2009-03-28 Paolo Bonzini <bonzini@gnu.org> * cp/cp-objcp-common.h (LANG_HOOKS_STATICP): Remove. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index a4871e9..ca19856 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -43,9 +43,6 @@ along with GCC; see the file COPYING3. If not see #else #define ATTRIBUTE_GCC_CXXDIAG(m, n) ATTRIBUTE_NONNULL(m) #endif -extern void cp_cpp_error (cpp_reader *, int, - const char *, va_list *) - ATTRIBUTE_GCC_CXXDIAG(3,0); #ifdef GCC_TOPLEV_H #error \ In order for the format checking to accept the C++ front end diagnostic \ diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 5eb8f28..161fa55 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2666,39 +2666,6 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec, #undef next_int } -/* Callback from cpp_error for PFILE to print diagnostics arising from - interpreting strings. The diagnostic is of type LEVEL; MSG is the - translated message and AP the arguments. */ - -void -cp_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, - const char *msg, va_list *ap) -{ - diagnostic_info diagnostic; - diagnostic_t dlevel; - switch (level) - { - case CPP_DL_WARNING: - case CPP_DL_WARNING_SYSHDR: - dlevel = DK_WARNING; - break; - case CPP_DL_PEDWARN: - dlevel = DK_PEDWARN; - break; - case CPP_DL_ERROR: - dlevel = DK_ERROR; - break; - case CPP_DL_ICE: - dlevel = DK_ICE; - break; - default: - gcc_unreachable (); - } - diagnostic_set_info_translated (&diagnostic, msg, ap, - input_location, dlevel); - report_diagnostic (&diagnostic); -} - /* Warn about the use of C++0x features when appropriate. */ void maybe_warn_cpp0x (const char* str) diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index bbd89d1..09e19a2 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -309,8 +309,7 @@ cp_lexer_new_main (void) /* Subsequent preprocessor diagnostics should use compiler diagnostic functions to get the compiler source location. */ - cpp_get_options (parse_in)->client_diagnostic = true; - cpp_get_callbacks (parse_in)->error = cp_cpp_error; + done_lexing = true; gcc_assert (lexer->next_token->type != CPP_PURGED); return lexer; diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index f323f36..8d01249 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -1,6 +1,6 @@ /* Language-independent diagnostic subroutines for the GNU Compiler Collection - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 - Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, + 2009 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis <gdr@codesourcery.com> This file is part of GCC. @@ -126,6 +126,7 @@ diagnostic_set_info_translated (diagnostic_info *diagnostic, const char *msg, diagnostic->message.args_ptr = args; diagnostic->message.format_spec = msg; diagnostic->location = location; + diagnostic->override_column = 0; diagnostic->kind = kind; diagnostic->option_index = 0; } @@ -153,6 +154,8 @@ diagnostic_build_prefix (diagnostic_info *diagnostic) }; const char *text = _(diagnostic_kind_text[diagnostic->kind]); expanded_location s = expand_location (diagnostic->location); + if (diagnostic->override_column) + s.column = diagnostic->override_column; gcc_assert (diagnostic->kind < DK_LAST_DIAGNOSTIC_KIND); return diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 19bc5e9..998c11e 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -1,5 +1,5 @@ /* Various declarations for language-independent diagnostics subroutines. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis <gdr@codesourcery.com> @@ -41,6 +41,7 @@ typedef struct diagnostic_info { text_info message; location_t location; + unsigned int override_column; /* TREE_BLOCK if the diagnostic is to be reported in some inline function inlined into other function, otherwise NULL. */ tree abstract_origin; @@ -185,6 +186,10 @@ extern diagnostic_context *global_dc; #define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D) +/* Override the column number to be used for reporting a + diagnostic. */ +#define diagnostic_override_column(DI, COL) (DI)->override_column = (COL) + /* Diagnostic related functions. */ extern void diagnostic_initialize (diagnostic_context *); extern void diagnostic_report_current_module (diagnostic_context *); diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 8bdf010..34d31ff 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2009-03-29 Joseph Myers <joseph@codesourcery.com> + + PR preprocessor/34695 + * cpp.c (cb_cpp_error): New. + (gfc_cpp_post_options): Don't set cpp_option->inhibit_warnings. + Don't check cpp_errors (cpp_in). + (gfc_cpp_init_0): Set cb->error. + 2009-03-29 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/38823 diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c index d45d0c1..fc78f98 100644 --- a/gcc/fortran/cpp.c +++ b/gcc/fortran/cpp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008 Free Software Foundation, Inc. +/* Copyright (C) 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -137,6 +137,9 @@ static void cb_include (cpp_reader *, source_location, const unsigned char *, static void cb_ident (cpp_reader *, source_location, const cpp_string *); static void cb_used_define (cpp_reader *, source_location, cpp_hashnode *); static void cb_used_undef (cpp_reader *, source_location, cpp_hashnode *); +static bool cb_cpp_error (cpp_reader *, int, location_t, unsigned int, + const char *, va_list *) + ATTRIBUTE_GCC_DIAG(5,0); void pp_dir_change (cpp_reader *, const char *); static int dump_macro (cpp_reader *, cpp_hashnode *, void *); @@ -452,7 +455,6 @@ gfc_cpp_post_options (void) cpp_option->cplusplus_comments = 0; cpp_option->pedantic = pedantic; - cpp_option->inhibit_warnings = inhibit_warnings; cpp_option->dollars_in_ident = gfc_option.flag_dollar_ok; cpp_option->discard_comments = gfc_cpp_option.discard_comments; @@ -465,9 +467,6 @@ gfc_cpp_post_options (void) cpp_post_options (cpp_in); - /* If an error has occurred in cpplib, note it so we fail immediately. */ - errorcount += cpp_errors (cpp_in); - gfc_cpp_register_include_paths (); } @@ -482,6 +481,7 @@ gfc_cpp_init_0 (void) cb->line_change = cb_line_change; cb->ident = cb_ident; cb->def_pragma = cb_def_pragma; + cb->error = cb_cpp_error; if (gfc_cpp_option.dump_includes) cb->include = cb_include; @@ -961,6 +961,54 @@ cb_used_define (cpp_reader *pfile, source_location line ATTRIBUTE_UNUSED, cpp_define_queue = q; } +/* Callback from cpp_error for PFILE to print diagnostics from the + preprocessor. The diagnostic is of type LEVEL, at location + LOCATION, with column number possibly overridden by COLUMN_OVERRIDE + if not zero; MSG is the translated message and AP the arguments. + Returns true if a diagnostic was emitted, false otherwise. */ + +static bool +cb_cpp_error (cpp_reader *pfile ATTRIBUTE_UNUSED, int level, + location_t location, unsigned int column_override, + const char *msg, va_list *ap) +{ + diagnostic_info diagnostic; + diagnostic_t dlevel; + int save_warn_system_headers = warn_system_headers; + bool ret; + + switch (level) + { + case CPP_DL_WARNING_SYSHDR: + warn_system_headers = 1; + /* Fall through. */ + case CPP_DL_WARNING: + dlevel = DK_WARNING; + break; + case CPP_DL_PEDWARN: + dlevel = DK_PEDWARN; + break; + case CPP_DL_ERROR: + dlevel = DK_ERROR; + break; + case CPP_DL_ICE: + dlevel = DK_ICE; + break; + case CPP_DL_NOTE: + dlevel = DK_NOTE; + break; + default: + gcc_unreachable (); + } + diagnostic_set_info_translated (&diagnostic, msg, ap, + location, dlevel); + if (column_override) + diagnostic_override_column (&diagnostic, column_override); + ret = report_diagnostic (&diagnostic); + if (level == CPP_DL_WARNING_SYSHDR) + warn_system_headers = save_warn_system_headers; + return ret; +} /* Callback called when -fworking-director and -E to emit working directory in cpp output file. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 37c447a..2b3a216 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2009-03-29 Joseph Myers <joseph@codesourcery.com> + + PR preprocessor/34695 + * gcc.dg/builtin-redefine.c, gcc.dg/cpp/redef2.c, + gcc.dg/cpp/redef3.c, gcc.dg/cpp/trad/redef2.c: Use dg-message + instead of dg-warning for "previous definition" messages. + * gcc.dg/cpp/Wvariadic-1.c, gcc.dg/cpp/Wvariadic-3.c: Expect + "warnings being treated as errors" message. + * gcc.dg/fltconst-1.c: Use -fshow-column. + 2009-03-29 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/38823 diff --git a/gcc/testsuite/gcc.dg/builtin-redefine.c b/gcc/testsuite/gcc.dg/builtin-redefine.c index f94d3f3..1d0f29d 100644 --- a/gcc/testsuite/gcc.dg/builtin-redefine.c +++ b/gcc/testsuite/gcc.dg/builtin-redefine.c @@ -28,7 +28,7 @@ #define __TIME__ "X" /* Re-define while defined. */ #define __TIME__ "Y" /* { dg-warning "\"__TIME__\" redefined" } */ -/* { dg-warning "previous definition" "" { target *-*-* } 28 } */ +/* { dg-message "previous definition" "" { target *-*-* } 28 } */ #undef __TIME__ /* Undefine while defined. */ @@ -39,7 +39,7 @@ #define __DATE__ "X" /* Re-define while defined. */ #define __DATE__ "Y" /* { dg-warning "\"__DATE__\" redefined" } */ -/* { dg-warning "previous definition" "" { target *-*-* } 39 } */ +/* { dg-message "previous definition" "" { target *-*-* } 39 } */ #undef __DATE__ /* Undefine while defined. */ @@ -48,7 +48,7 @@ #define __TIMESTAMP__ "X" /* Re-define while defined. */ #define __TIMESTAMP__ "Y" /* { dg-warning "\"__TIMESTAMP__\" redefined" } */ -/* { dg-warning "previous definition" "" { target *-*-* } 48 } */ +/* { dg-message "previous definition" "" { target *-*-* } 48 } */ #undef __TIMESTAMP__ /* Undefine while defined. */ diff --git a/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c b/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c index 88e2793..b034aac 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c +++ b/gcc/testsuite/gcc.dg/cpp/Wvariadic-1.c @@ -4,3 +4,4 @@ #define f(x,...) /* { dg-error "variadic" } */ #define g(x,y...) /* { dg-error "variadic" } */ int not_empty; +/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c b/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c index 056af83..0317c3c 100644 --- a/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c +++ b/gcc/testsuite/gcc.dg/cpp/Wvariadic-3.c @@ -4,3 +4,4 @@ #define f(x,...) #define g(x,y...) /* { dg-error "variadic" } */ int not_empty; +/* { dg-message "warnings being treated as errors" "" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef2.c b/gcc/testsuite/gcc.dg/cpp/redef2.c index b0068d9..57fa3b1 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef2.c +++ b/gcc/testsuite/gcc.dg/cpp/redef2.c @@ -23,9 +23,9 @@ { dg-warning "redefined" "redef ro" { target *-*-* } 12 } { dg-warning "redefined" "redef va" { target *-*-* } 15 } - { dg-warning "previous" "prev def mac" { target *-*-* } 6 } - { dg-warning "previous" "prev def mac" { target *-*-* } 7 } - { dg-warning "previous" "prev def mac" { target *-*-* } 8 } - { dg-warning "previous" "prev def ro" { target *-*-* } 11 } - { dg-warning "previous" "prev def va" { target *-*-* } 14 } + { dg-message "previous" "prev def mac" { target *-*-* } 6 } + { dg-message "previous" "prev def mac" { target *-*-* } 7 } + { dg-message "previous" "prev def mac" { target *-*-* } 8 } + { dg-message "previous" "prev def ro" { target *-*-* } 11 } + { dg-message "previous" "prev def va" { target *-*-* } 14 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/redef3.c b/gcc/testsuite/gcc.dg/cpp/redef3.c index 78ee71e..1c541a4 100644 --- a/gcc/testsuite/gcc.dg/cpp/redef3.c +++ b/gcc/testsuite/gcc.dg/cpp/redef3.c @@ -15,7 +15,7 @@ { dg-warning "redefined" "redef B" { target *-*-* } 9 } { dg-warning "redefined" "redef D" { target *-*-* } 11 } { dg-warning "redefined" "redef E" { target *-*-* } 12 } - { dg-warning "previous" "prev def A" { target *-*-* } 6 } - { dg-warning "previous" "prev def B" { target *-*-* } 8 } - { dg-warning "previous" "prev def D/E" { target *-*-* } 0 } + { dg-message "previous" "prev def A" { target *-*-* } 6 } + { dg-message "previous" "prev def B" { target *-*-* } 8 } + { dg-message "previous" "prev def D/E" { target *-*-* } 0 } */ diff --git a/gcc/testsuite/gcc.dg/cpp/trad/redef2.c b/gcc/testsuite/gcc.dg/cpp/trad/redef2.c index 269a846..5fcd5eb 100644 --- a/gcc/testsuite/gcc.dg/cpp/trad/redef2.c +++ b/gcc/testsuite/gcc.dg/cpp/trad/redef2.c @@ -2,31 +2,31 @@ /* { dg-do preprocess } */ -#define foo bar /* { dg-warning "previous def" "foo prev def" } */ +#define foo bar /* { dg-message "previous def" "foo prev def" } */ #define foo barr /* { dg-warning "redefined" "foo redefined" } */ #undef foo -#define foo bar /* { dg-warning "previous def" "foo prev def 2" } */ +#define foo bar /* { dg-message "previous def" "foo prev def 2" } */ #define foo() bar /* { dg-warning "redefined" "foo redefined 2" } */ #undef foo -#define foo() bar /* { dg-warning "previous def" "foo prev def" } */ +#define foo() bar /* { dg-message "previous def" "foo prev def" } */ #define foo() barr /* { dg-warning "redefined" "foo redefined" } */ -#define quux(thud) a thud b /* { dg-warning "previous def" "quux prev def" } */ +#define quux(thud) a thud b /* { dg-message "previous def" "quux prev def" } */ #define quux(thu) a thud b /* { dg-warning "redefined" "quux redefined" } */ -#define bar(x, y) x+y /* { dg-warning "previous def" "bar prev def" } */ +#define bar(x, y) x+y /* { dg-message "previous def" "bar prev def" } */ #define bar(x, y) x+x /* { dg-warning "redefined" "bar redefined" } */ -#define bat(x, y) x+y /* { dg-warning "previous def" "bat prev def" } */ +#define bat(x, y) x+y /* { dg-message "previous def" "bat prev def" } */ #define bat(x, y) x+ y /* { dg-warning "redefined" "bat redefined" } */ -#define baz(x, y) x+y /* { dg-warning "previous def" "baz prev def" } */ +#define baz(x, y) x+y /* { dg-message "previous def" "baz prev def" } */ #define baz(x, y) x +y /* { dg-warning "redefined" "baz redefined" } */ -#define f(x, y) "x y" /* { dg-warning "previous def" "f prev def" } */ +#define f(x, y) "x y" /* { dg-message "previous def" "f prev def" } */ #define f(x, y) "x y" /* { dg-warning "redefined" "f redefined" } */ -#define g(x, y) 'x' /* { dg-warning "previous def" "g prev def" } */ +#define g(x, y) 'x' /* { dg-message "previous def" "g prev def" } */ #define g(x, y) ' x' /* { dg-warning "redefined" "g redefined" } */ diff --git a/gcc/testsuite/gcc.dg/fltconst-1.c b/gcc/testsuite/gcc.dg/fltconst-1.c index 85e1d34..1b75210 100644 --- a/gcc/testsuite/gcc.dg/fltconst-1.c +++ b/gcc/testsuite/gcc.dg/fltconst-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-std=gnu99" } */ +/* { dg-options "-std=gnu99 -fshow-column" } */ double a = 1.ld; /* { dg-error "12:invalid suffix" } */ double b = 1.fd; /* { dg-error "12:invalid suffix" } */ |