GCC Middle and Back End API Reference
diagnostic-core.h File Reference
#include "input.h"
#include "bversion.h"
#include "diagnostic.def"
Include dependency graph for diagnostic-core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEFINE_DIAGNOSTIC_KIND(K, msgid, C)   K,
#define GCC_DIAG_STYLE   __gcc_tdiag__
#define ATTRIBUTE_GCC_DIAG(m, n)   __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)

Enumerations

enum  diagnostic_t { DEFINE_DIAGNOSTIC_KIND, DEFINE_DIAGNOSTIC_KIND, DK_POP }

Functions

const char * trim_filename (const char *)
void internal_error (const char *,...) ATTRIBUTE_GCC_DIAG(1
bool warning (int, const char *,...) ATTRIBUTE_GCC_DIAG(2
bool bool warning_at (location_t, int, const char *,...) ATTRIBUTE_GCC_DIAG(3
bool bool void error (const char *,...) ATTRIBUTE_GCC_DIAG(1
bool bool void void error_n (location_t, int, const char *, const char *,...) ATTRIBUTE_GCC_DIAG(3
bool bool void void ATTRIBUTE_GCC_DIAG (4, 5)
void error_at (location_t, const char *,...) ATTRIBUTE_GCC_DIAG(2
void void fatal_error (const char *,...) ATTRIBUTE_GCC_DIAG(1
bool pedwarn (location_t, int, const char *,...) ATTRIBUTE_GCC_DIAG(3
bool bool permerror (location_t, const char *,...) ATTRIBUTE_GCC_DIAG(2
bool bool void sorry (const char *,...) ATTRIBUTE_GCC_DIAG(1
bool bool void void inform (location_t, const char *,...) ATTRIBUTE_GCC_DIAG(2
bool bool void void void inform_n (location_t, int, const char *, const char *,...) ATTRIBUTE_GCC_DIAG(3
void verbatim (const char *,...) ATTRIBUTE_GCC_DIAG(1
void bool emit_diagnostic (diagnostic_t, location_t, int, const char *,...) ATTRIBUTE_GCC_DIAG(4
void bool bool seen_error (void)

Variables

const char * progname
void ATTRIBUTE_NORETURN

Macro Definition Documentation

#define ATTRIBUTE_GCC_DIAG (   m,
 
)    __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)

None of these functions are suitable for ATTRIBUTE_PRINTF, because each language front end can extend them with its own set of format specifiers. We must use custom format checks.

#define DEFINE_DIAGNOSTIC_KIND (   K,
  msgid,
 
)    K,
#define GCC_DIAG_STYLE   __gcc_tdiag__

If we haven't already defined a front-end-specific diagnostics style, use the generic one.


Enumeration Type Documentation

Declarations of core diagnostic functionality for code that does not need to deal with diagnostic contexts or diagnostic info structures. Copyright (C) 1998-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. Constants used to discriminate diagnostics.

Enumerator:
DEFINE_DIAGNOSTIC_KIND 

Copyright (C) 2001-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. DK_UNSPECIFIED must be first so it has a value of zero. We never assign this kind to an actual diagnostic, we only use this in variables that can hold a kind, to mean they have yet to have a kind specified. I.e. they're uninitialized. Within the diagnostic machinery, this kind also means "don't change the existing kind", meaning "no change is specified".

DEFINE_DIAGNOSTIC_KIND 

Copyright (C) 2001-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. DK_UNSPECIFIED must be first so it has a value of zero. We never assign this kind to an actual diagnostic, we only use this in variables that can hold a kind, to mean they have yet to have a kind specified. I.e. they're uninitialized. Within the diagnostic machinery, this kind also means "don't change the existing kind", meaning "no change is specified".

DK_POP 

This is used for tagging pragma pops in the diagnostic classification history chain.


Function Documentation

bool bool void void void ATTRIBUTE_GCC_DIAG ( ,
 
)
void bool emit_diagnostic ( diagnostic_t  ,
location_t  ,
int  ,
const char *  ,
  ... 
)
bool bool void error ( const char *  ,
  ... 
)

Referenced by build_ssa_operands(), cancel_loop(), cancel_loop_tree(), cgraph_can_remove_if_no_direct_calls_and_refs_p(), cgraph_debug_gimple_stmt(), cgraph_edge_cannot_lead_to_return(), clone_of_p(), collect_callers_of_node_1(), complete_mode(), compute_frequency_overlap(), convert_to_complex(), convert_to_pointer(), coverage_obj_fn(), debug_symtab(), decl_overlaps_hard_reg_set_p(), dump_symtab(), emit_common(), emit_mode_fbit(), emit_tls_common(), expand_builtin_atomic_exchange(), find_partition_fixes(), finish_automaton_decl_table(), first_stmt(), fixup_partitions(), fixup_same_cpp_alias_visibility(), get_last_bb_insn(), get_memmodel(), gimple_move_stmt_histograms(), gimple_push_cleanup(), gimple_split_edge(), gimplify_variable_sized_compare(), go_finish(), handle_alias_pairs(), initializer_constant_valid_p_1(), initiate_insn_decl_table(), insert_decl(), insert_insn_decl(), last_stmt(), make_partial_integer_mode(), make_pass_set_nothrow_function_flags(), make_vector_mode(), make_vector_modes(), new_mode(), output_constant(), output_constructor_bitfield(), parse_input_constraint(), print_rtl_with_bb(), process_bypass_1(), process_bypass_2(), process_excls(), read_counts_file(), read_profile_edge_counts(), register_callback(), renumerate_operands_in_pattern(), resolve_asm_operand_names(), rtl_verify_bb_pointers(), rtl_verify_edges(), split_edge_bb_loc(), swap_ssa_operands(), use_blocks_for_decl_p(), valid_fixed_convert_types_p(), verify_edge_count_and_frequency(), verify_expr(), verify_expr_location_1(), verify_expr_no_block(), verify_gimple_assign(), verify_gimple_assign_ternary(), verify_gimple_goto(), verify_node_sharing(), verify_phi_args(), verify_ssa(), verify_ssa_name(), verify_symtab_base(), verify_types_in_gimple_min_lval(), verify_types_in_gimple_reference(), verify_use(), visit_hist(), and write_lookup_constraint().

bool bool void void error_n ( location_t  ,
int  ,
const char *  ,
const char *  ,
  ... 
)
bool bool void void inform ( location_t  ,
const char *  ,
  ... 
)
bool bool void void void inform_n ( location_t  ,
int  ,
const char *  ,
const char *  ,
  ... 
)
bool pedwarn ( location_t  ,
int  ,
const char *  ,
  ... 
)

Pass one of the OPT_W* from options.h as the second parameter.

Referenced by wrapup_global_declarations().

bool bool permerror ( location_t  ,
const char *  ,
  ... 
)
void bool bool seen_error ( void  )

Return true if an error or a "sorry" has been seen. Various processing is disabled after errors.

Referenced by canonicalize_component_ref(), gimplify_omp_workshare(), and lto_streamer_init().

bool bool void sorry ( const char *  ,
  ... 
)

Referenced by input_refs().

const char* trim_filename ( const char *  )
void verbatim ( const char *  ,
  ... 
)

Variable Documentation

void void ATTRIBUTE_NORETURN
const char* progname

Basic error reporting routines. Copyright (C) 1999-2013 Free Software Foundation, Inc.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GCC; see the file COPYING3. If not see http://www.gnu.org/licenses/. warning, error, and fatal. These definitions are suitable for use in the generator programs; the compiler has a more elaborate suite of diagnostic printers, found in diagnostic.c. Set this to argv[0] at the beginning of main.

Referenced by emit_mode_fbit(), main(), and write_insn_constraint_len().