aboutsummaryrefslogtreecommitdiff
path: root/gcc/cppinit.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2002-04-14 18:42:47 +0000
committerNeil Booth <neil@gcc.gnu.org>2002-04-14 18:42:47 +0000
commitebef4e8ca795b46b1f51a82d4b93c35f1eacd54c (patch)
tree75fa26f503af564c85d2a564dac4f51a833dca58 /gcc/cppinit.c
parentc19a385911ad926bd88713535b5a93c947d9f1bd (diff)
downloadgcc-ebef4e8ca795b46b1f51a82d4b93c35f1eacd54c.zip
gcc-ebef4e8ca795b46b1f51a82d4b93c35f1eacd54c.tar.gz
gcc-ebef4e8ca795b46b1f51a82d4b93c35f1eacd54c.tar.bz2
cpperror.c (print_location): Don't print include chain if line == 0.
* cpperror.c (print_location): Don't print include chain if line == 0. (cpp_begin_message): Update to use DL_ macros. (cpp_ice, cpp_fatal, cpp_error_from_errno, cpp_warning, cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line, cpp_notice, cpp_notice_from_errno): Remove. (cpp_error, cpp_error_with_line): Update to take a diagnostic level. (cpp_errno): New. * cppexp.c (CPP_ICE): Remove. (SYNTAX_ERROR, SYNTAX_ERROR2, parse_number, parse_defined, lex, integer_overflow, _cpp_parse_expr): Update. * cppfiles.c (read_include_file, find_include_file, handle_missing_header, _cpp_read_file, remap_filename): Update. * cpphash.h (enum error_type): Remove. (_cpp_begin_message): Update. * cppinit.c (append_include_chain, remove_dup_dirs, output_deps, cpp_handle_option, cpp_post_options): Update. * cpplex.c (trigraph_p, skip_escaped_newlines, skip_block_comment, skip_whitespace, parse_identifier, parse_slow, parse_string, _cpp_lex_direct, cpp_spell_token, maybe_read_ucs, cpp_parse_escape, cpp_interpret_charconst): Update. * cpplib.c (check_eol, directive_diagnostics, _cpp_handle_directive, lex_macro_node, do_undef, glue_header_name, parse_include, do_include_common, read_flag, do_line, do_linemarker, do_ident, cpp_register_pragma, do_pragma_once, do_pragma_system_header, do_pragma_poison, do_pragma_dependency, _cpp_do__Pragma, do_else, do_elif, do_endif, parse_answer, parse_assertion, do_assert, _cpp_pop_buffer, do_diagnostic): Update. * cpplib.h (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN, DL_ERROR, DL_FATAL, DL_ICE, DL_EXTRACT, DL_WARNING_P): New. (cpp_ice, cpp_fatal, cpp_error_from_errno, cpp_warning, cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line, cpp_notice, cpp_notice_from_errno): Remove. (cpp_error, cpp_error_with_line): Update to take a diagnostic level. (cpp_errno): New. * cppmacro.c (builtin_macro, stringify_arg, paste_all_tokens, collect_args, enter_macro_context, save_parameter, parse_params, _cpp_create_definition, check_trad_stringification, cpp_macro_definition): Update. * cppmain.c (cpp_preprocess_file): Update. * fix-header.c (read_scan_file): Update. From-SVN: r52302
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r--gcc/cppinit.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index ce950c0..a9092ed 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -225,7 +225,7 @@ append_include_chain (pfile, dir, path, cxx_aware)
{
/* Dirs that don't exist are silently ignored. */
if (errno != ENOENT)
- cpp_notice_from_errno (pfile, dir);
+ cpp_errno (pfile, DL_ERROR, dir);
else if (CPP_OPTION (pfile, verbose))
fprintf (stderr, _("ignoring nonexistent directory \"%s\"\n"), dir);
free (dir);
@@ -234,7 +234,7 @@ append_include_chain (pfile, dir, path, cxx_aware)
if (!S_ISDIR (st.st_mode))
{
- cpp_notice (pfile, "%s: Not a directory", dir);
+ cpp_error_with_line (pfile, DL_ERROR, 0, 0, "%s: Not a directory", dir);
free (dir);
return;
}
@@ -308,16 +308,16 @@ remove_dup_dirs (pfile, head)
{
if (cur->sysp && !other->sysp)
{
- cpp_warning (pfile,
- "changing search order for system directory \"%s\"",
- cur->name);
+ cpp_error (pfile, DL_WARNING,
+ "changing search order for system directory \"%s\"",
+ cur->name);
if (strcmp (cur->name, other->name))
- cpp_warning (pfile,
- " as it is the same as non-system directory \"%s\"",
- other->name);
+ cpp_error (pfile, DL_WARNING,
+ " as it is the same as non-system directory \"%s\"",
+ other->name);
else
- cpp_warning (pfile,
- " as it has already been specified as a non-system directory");
+ cpp_error (pfile, DL_WARNING,
+ " as it has already been specified as a non-system directory");
}
cur = remove_dup_dir (pfile, prev);
break;
@@ -1092,7 +1092,7 @@ output_deps (pfile)
deps_stream = fopen (CPP_OPTION (pfile, deps_file), deps_mode);
if (deps_stream == 0)
{
- cpp_notice_from_errno (pfile, CPP_OPTION (pfile, deps_file));
+ cpp_errno (pfile, DL_ERROR, CPP_OPTION (pfile, deps_file));
return;
}
}
@@ -1106,7 +1106,7 @@ output_deps (pfile)
if (deps_stream != stdout)
{
if (ferror (deps_stream) || fclose (deps_stream) != 0)
- cpp_fatal (pfile, "I/O error on output");
+ cpp_error (pfile, DL_FATAL, "I/O error on output");
}
}
@@ -1350,7 +1350,8 @@ cpp_handle_option (pfile, argc, argv, ignore)
else if (CPP_OPTION (pfile, out_fname) == NULL)
CPP_OPTION (pfile, out_fname) = argv[i];
else
- cpp_fatal (pfile, "too many filenames. Type %s --help for usage info",
+ cpp_error (pfile, DL_FATAL,
+ "too many filenames. Type %s --help for usage info",
progname);
}
else
@@ -1377,7 +1378,8 @@ cpp_handle_option (pfile, argc, argv, ignore)
arg = argv[++i];
if (!arg)
{
- cpp_fatal (pfile, cl_options[opt_index].msg, argv[i - 1]);
+ cpp_error (pfile, DL_FATAL,
+ cl_options[opt_index].msg, argv[i - 1]);
return argc;
}
}
@@ -1545,7 +1547,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
CPP_OPTION (pfile, out_fname) = arg;
else
{
- cpp_fatal (pfile, "output filename specified twice");
+ cpp_error (pfile, DL_FATAL, "output filename specified twice");
return argc;
}
break;
@@ -1657,7 +1659,7 @@ cpp_handle_option (pfile, argc, argv, ignore)
}
else
{
- cpp_fatal (pfile, "-I- specified twice");
+ cpp_error (pfile, DL_FATAL, "-I- specified twice");
return argc;
}
}
@@ -1843,7 +1845,8 @@ cpp_post_options (pfile)
(CPP_OPTION (pfile, print_deps_missing_files)
|| CPP_OPTION (pfile, deps_file)
|| CPP_OPTION (pfile, deps_phony_targets)))
- cpp_fatal (pfile, "you must additionally specify either -M or -MM");
+ cpp_error (pfile, DL_FATAL,
+ "you must additionally specify either -M or -MM");
}
/* Set up dependency-file output. On exit, if print_deps is non-zero