-void
-diagnostic_report_current_module (context)
- diagnostic_context *context;
-{
- struct file_stack *p;
-
- if (output_needs_newline (&context->buffer))
- {
- output_add_newline (&context->buffer);
- output_needs_newline (&context->buffer) = false;
- }
-
- if (input_file_stack && input_file_stack->next != 0
- && diagnostic_last_module_changed (context))
- {
- for (p = input_file_stack->next; p; p = p->next)
- if (p == input_file_stack->next)
- output_verbatim (&context->buffer,
- "In file included from %s:%d",
- p->location.file, p->location.line);
- else
- output_verbatim (&context->buffer,
- ",\n from %s:%d",
- p->location.file, p->location.line);
- output_verbatim (&context->buffer, ":\n");
- diagnostic_set_last_module (context);
- }
-}
-
-static void
-default_diagnostic_starter (context, diagnostic)
- diagnostic_context *context;
- diagnostic_info *diagnostic;
-{
- diagnostic_report_current_function (context);
- output_set_prefix (&context->buffer, diagnostic_build_prefix (diagnostic));
-}
-
-static void
-default_diagnostic_finalizer (context, diagnostic)
- diagnostic_context *context;
- diagnostic_info *diagnostic __attribute__((unused));
-{
- output_destroy_prefix (&context->buffer);
-}
-
-void
-inform VPARAMS ((const char *msgid, ...))
-{
- diagnostic_info diagnostic;
-
- VA_OPEN (ap, msgid);
- VA_FIXEDARG (ap, const char *, msgid);
-
- diagnostic_set_info (&diagnostic, msgid, &ap, input_filename, input_line,
- DK_NOTE);
- report_diagnostic (&diagnostic);
- VA_CLOSE (ap);
-}
-
-void
-warn_deprecated_use (node)
- tree node;
-{
- if (node == 0 || !warn_deprecated_decl)
- return;
-
- if (DECL_P (node))
- warning ("`%s' is deprecated (declared at %s:%d)",
- IDENTIFIER_POINTER (DECL_NAME (node)),
- DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
- else if (TYPE_P (node))
- {
- const char *what = NULL;
- tree decl = TYPE_STUB_DECL (node);
-
- if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
- what = IDENTIFIER_POINTER (TYPE_NAME (node));
- else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (node)))
- what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
-
- if (what)
- {
- if (decl)
- warning ("`%s' is deprecated (declared at %s:%d)", what,
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
- else
- warning ("`%s' is deprecated", what);
- }
- else if (decl)
- warning ("type is deprecated (declared at %s:%d)",
- DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
- else
- warning ("type is deprecated");
- }
-}
-