OSDN Git Service

* c-common.h (check_function_format): Remove first parameter.
[pf3gnuchains/gcc-fork.git] / gcc / c-common.h
index 337eb6d..2ae116e 100644 (file)
@@ -280,7 +280,6 @@ struct c_language_function GTY(()) {
 
 /* Language-specific hooks.  */
 
-extern int (*lang_gimplify_stmt) (tree *);
 extern void (*lang_expand_function_end) (void);
 
 /* Callback that determines if it's ok for a function to have no
@@ -295,16 +294,15 @@ extern tree push_stmt_list (void);
 extern tree re_push_stmt_list (tree);
 extern tree pop_stmt_list (tree);
 extern tree add_stmt (tree);
-extern void add_decl_stmt (tree);
 extern void push_cleanup (tree, tree, bool);
 
 extern tree walk_stmt_tree (tree *, walk_tree_fn, void *);
-extern void prep_stmt (tree);
 extern int c_expand_decl (tree);
 
 extern int field_decl_cmp (const void *, const void *);
 extern void resort_sorted_fields (void *, void *, gt_pointer_operator, 
                                   void *);
+extern bool has_c_linkage (tree decl);
 \f
 /* Switches common to the C front ends.  */
 
@@ -352,6 +350,10 @@ extern char flag_dump_macros;
 
 extern char flag_dump_includes;
 
+/* Nonzero means process PCH files while preprocessing.  */
+
+extern bool flag_pch_preprocess;
+
 /* The file name to which we should write a precompiled header, or
    NULL if no header will be written in this compile.  */
 
@@ -401,64 +403,11 @@ extern int flag_const_strings;
 extern int flag_signed_bitfields;
 extern int explicit_flag_signed_bitfields;
 
-/* Nonzero means warn about pointer casts that can drop a type qualifier
-   from the pointer target type.  */
-
-extern int warn_cast_qual;
-
-/* Warn about functions which might be candidates for format attributes.  */
-
-extern int warn_missing_format_attribute;
-
-/* Nonzero means warn about sizeof(function) or addition/subtraction
-   of function pointers.  */
-
-extern int warn_pointer_arith;
-
-/* Nonzero means warn for any global function def
-   without separate previous prototype decl.  */
-
-extern int warn_missing_prototypes;
-
-/* Warn if adding () is suggested.  */
-
-extern int warn_parentheses;
-
-/* Warn if initializer is not completely bracketed.  */
-
-extern int warn_missing_braces;
-
-/* Warn about comparison of signed and unsigned values.
-   If -1, neither -Wsign-compare nor -Wno-sign-compare has been specified.  */
-
-extern int warn_sign_compare;
-
-/* Nonzero means warn about usage of long long when `-pedantic'.  */
-
-extern int warn_long_long;
-
 /* Nonzero means warn about deprecated conversion from string constant to
    `char *'.  */
 
 extern int warn_write_strings;
 
-/* Nonzero means warn about multiple (redundant) decls for the same single
-   variable or function.  */
-
-extern int warn_redundant_decls;
-
-/* Warn about testing equality of floating point numbers.  */
-
-extern int warn_float_equal;
-
-/* Warn about a subscript that has type char.  */
-
-extern int warn_char_subscripts;
-
-/* Warn if a type conversion is done that might have confusing results.  */
-
-extern int warn_conversion;
-
 /* Warn about #pragma directives that are not recognized.  */      
 
 extern int warn_unknown_pragmas; /* Tri state variable.  */  
@@ -468,35 +417,10 @@ extern int warn_unknown_pragmas; /* Tri state variable.  */
 
 extern int warn_format;
 
-/* Warn about Y2K problems with strftime formats.  */
-
-extern int warn_format_y2k;
-
-/* Warn about excess arguments to formats.  */
-
-extern int warn_format_extra_args;
-
-/* Warn about zero-length formats.  */
-
-extern int warn_format_zero_length;
-
-/* Warn about non-literal format arguments.  */
-
-extern int warn_format_nonliteral;
-
-/* Warn about possible security problems with calls to format functions.  */
-
-extern int warn_format_security;
-
 
 /* C/ObjC language option variables.  */
 
 
-/* Nonzero means message about use of implicit function declarations;
- 1 means warning; 2 means error.  */
-
-extern int mesg_implicit_function_declaration;
-
 /* Nonzero means allow type mismatches in conditional expressions;
    just make their values `void'.  */
 
@@ -514,68 +438,10 @@ extern int flag_isoc99;
 
 extern int flag_hosted;
 
-/* Nonzero means warn when casting a function call to a type that does
-   not match the return type (e.g. (float)sqrt() or (anything*)malloc()
-   when there is no previous declaration of sqrt or malloc.  */
-
-extern int warn_bad_function_cast;
-
-/* Warn about traditional constructs whose meanings changed in ANSI C.  */
-
-extern int warn_traditional;
-
-/* Nonzero means warn for a declaration found after a statement.  */
-
-extern int warn_declaration_after_statement;
-
-/* Nonzero means warn for non-prototype function decls
-   or non-prototyped defs without previous prototype.  */
-
-extern int warn_strict_prototypes;
-
-/* Nonzero means warn for any global function def
-   without separate previous decl.  */
-
-extern int warn_missing_declarations;
-
-/* Nonzero means warn about extern declarations of objects not at
-   file-scope level and about *all* declarations of functions (whether
-   extern or static) not at file-scope level.  Note that we exclude
-   implicit function declarations.  To get warnings about those, use
-   -Wimplicit.  */
-
-extern int warn_nested_externs;
-
 /* Warn if main is suspicious.  */
 
 extern int warn_main;
 
-/* Nonzero means warn about possible violations of sequence point rules.  */
-
-extern int warn_sequence_point;
-
-/* Nonzero means warn about uninitialized variable when it is initialized with itself. 
-   For example: int i = i;, GCC will not warn about this when warn_init_self is nonzero.  */
-
-extern int warn_init_self;
-
-
-/* Nonzero means to warn about compile-time division by zero.  */
-extern int warn_div_by_zero;
-
-/* Nonzero means warn about use of implicit int.  */
-
-extern int warn_implicit_int;
-
-/* Warn about NULL being passed to argument slots marked as requiring
-   non-NULL.  */ 
-      
-extern int warn_nonnull;
-
-/* Warn about old-style parameter declaration.  */
-
-extern int warn_old_style_definition;
-
 
 /* ObjC language option variables.  */
 
@@ -599,25 +465,6 @@ extern int print_struct_values;
 
 extern const char *constant_string_class_name;
 
-/* Warn if multiple methods are seen for the same selector, but with
-   different argument types.  Performs the check on the whole selector
-   table at the end of compilation.  */
-
-extern int warn_selector;
-
-/* Warn if a @selector() is found, and no method with that selector
-   has been previously declared.  The check is done on each
-   @selector() as soon as it is found - so it warns about forward
-   declarations.  */
-
-extern int warn_undeclared_selector;
-
-/* Warn if methods required by a protocol are not implemented in the 
-   class adopting it.  When turned off, methods inherited to that
-   class are also considered implemented.  */
-
-extern int warn_protocol;
-
 
 /* C++ language option variables.  */
 
@@ -720,70 +567,10 @@ extern int flag_permissive;
 
 extern int flag_enforce_eh_specs;
 
-/* Nonzero means warn about things that will change when compiling
-   with an ABI-compliant compiler.  */
-
-extern int warn_abi;
-
-/* Nonzero means warn about invalid uses of offsetof.  */
-extern int warn_invalid_offsetof;
-
 /* Nonzero means warn about implicit declarations.  */
 
 extern int warn_implicit;
 
-/* Nonzero means warn when all ctors or dtors are private, and the class
-   has no friends.  */
-
-extern int warn_ctor_dtor_privacy;
-
-/* Nonzero means warn in function declared in derived class has the
-   same name as a virtual in the base class, but fails to match the
-   type signature of any virtual function in the base class.  */
-
-extern int warn_overloaded_virtual;
-
-/* Nonzero means warn when declaring a class that has a non virtual
-   destructor, when it really ought to have a virtual one.  */
-
-extern int warn_nonvdtor;
-
-/* Nonzero means warn when the compiler will reorder code.  */
-
-extern int warn_reorder;
-
-/* Nonzero means warn when synthesis behavior differs from Cfront's.  */
-
-extern int warn_synth;
-
-/* Nonzero means warn when we convert a pointer to member function
-   into a pointer to (void or function).  */
-
-extern int warn_pmf2ptr;
-
-/* Nonzero means warn about violation of some Effective C++ style rules.  */
-
-extern int warn_ecpp;
-
-/* Nonzero means warn where overload resolution chooses a promotion from
-   unsigned to signed over a conversion to an unsigned of the same size.  */
-
-extern int warn_sign_promo;
-
-/* Nonzero means warn when an old-style cast is used.  */
-
-extern int warn_old_style_cast;
-
-/* Nonzero means warn when non-templatized friend functions are
-   declared within a template */
-
-extern int warn_nontemplate_friend;
-
-/* Nonzero means complain about deprecated features.  */
-
-extern int warn_deprecated;
-
 /* Maximum template instantiation depth.  This limit is rather
    arbitrary, but it exists to limit the time it takes to notice
    infinite template instantiations.  */
@@ -840,7 +627,7 @@ extern void check_function_arguments_recurse (void (*)
                                               unsigned HOST_WIDE_INT),
                                              void *, tree,
                                              unsigned HOST_WIDE_INT);
-extern void check_function_format (int *, tree, tree);
+extern void check_function_format (tree, tree);
 extern void set_Wformat (int);
 extern tree handle_format_attribute (tree *, tree, tree, int, bool *);
 extern tree handle_format_arg_attribute (tree *, tree, tree, int, bool *);
@@ -861,7 +648,6 @@ extern void binary_op_error (enum tree_code);
 #define my_friendly_assert(EXP, N) (void) \
  (((EXP) == 0) ? (fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0) : 0)
 
-extern tree c_expand_expr_stmt (tree);
 /* Validate the expression after `case' and apply default promotions.  */
 extern tree check_case_value (tree);
 extern tree fix_string_type (tree);
@@ -923,13 +709,6 @@ extern void finish_file    (void);
 #define STATEMENT_LIST_STMT_EXPR(NODE) \
   TREE_LANG_FLAG_1 (STATEMENT_LIST_CHECK (NODE))
 
-/* IF_STMT accessors. These give access to the condition of the if
-   statement, the then block of the if statement, and the else block
-   of the if statement if it exists.  */
-#define IF_COND(NODE)           TREE_OPERAND (IF_STMT_CHECK (NODE), 0)
-#define THEN_CLAUSE(NODE)       TREE_OPERAND (IF_STMT_CHECK (NODE), 1)
-#define ELSE_CLAUSE(NODE)       TREE_OPERAND (IF_STMT_CHECK (NODE), 2)
-
 /* WHILE_STMT accessors. These give access to the condition of the
    while statement and the body of the while statement, respectively.  */
 #define WHILE_COND(NODE)        TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0)
@@ -940,11 +719,6 @@ extern void finish_file    (void);
 #define DO_COND(NODE)           TREE_OPERAND (DO_STMT_CHECK (NODE), 0)
 #define DO_BODY(NODE)           TREE_OPERAND (DO_STMT_CHECK (NODE), 1)
 
-/* RETURN_STMT accessors. These give the expression associated with a
-   return statement, and whether it should be ignored when expanding
-   (as opposed to inlining).  */
-#define RETURN_STMT_EXPR(NODE)  TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
-
 /* EXPR_STMT accessor. This gives the expression associated with an
    expression statement.  */
 #define EXPR_STMT_EXPR(NODE)    TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0)
@@ -959,10 +733,6 @@ extern void finish_file    (void);
 
 #define SWITCH_TYPE(NODE)      TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 2)
 
-/* DECL_STMT accessor. This gives access to the DECL associated with
-   the given declaration statement.  */
-#define DECL_STMT_DECL(NODE)    TREE_OPERAND (DECL_STMT_CHECK (NODE), 0)
-
 /* STMT_EXPR accessor.  */
 #define STMT_EXPR_STMT(NODE)    TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0)
 
@@ -974,17 +744,7 @@ extern void finish_file    (void);
 #define COMPOUND_LITERAL_EXPR_DECL_STMT(NODE)          \
   TREE_OPERAND (COMPOUND_LITERAL_EXPR_CHECK (NODE), 0)
 #define COMPOUND_LITERAL_EXPR_DECL(NODE)                       \
-  DECL_STMT_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE))
-
-/* The body of the CLEANUP_STMT.  */
-#define CLEANUP_BODY(NODE) \
-  TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0)
-/* The cleanup to run in a CLEANUP_STMT.  */
-#define CLEANUP_EXPR(NODE) \
-  TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1)
-/* The VAR_DECL to clean up in a CLEANUP_STMT.  */
-#define CLEANUP_DECL(NODE) \
-  TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 2)
+  DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_STMT (NODE))
 
 #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
 
@@ -997,9 +757,8 @@ enum c_tree_code {
 #undef DEFTREECODE
 
 #define c_common_stmt_codes                            \
-   CLEANUP_STMT,       EXPR_STMT,                      \
-   DECL_STMT,          IF_STMT,        FOR_STMT,       \
-   WHILE_STMT,         DO_STMT,        RETURN_STMT,    \
+   EXPR_STMT,          FOR_STMT,                       \
+   WHILE_STMT,         DO_STMT,                        \
    BREAK_STMT,         CONTINUE_STMT,  SWITCH_STMT
 
 /* TRUE if a code represents a statement.  The front end init
@@ -1033,13 +792,11 @@ extern int anon_aggr_type_p (tree);
 
 extern void emit_local_var (tree);
 extern void make_rtl_for_local_static (tree);
-extern tree c_expand_return (tree);
 extern tree do_case (tree, tree);
 extern tree build_stmt (enum tree_code, ...);
 extern tree build_case_label (tree, tree, tree);
 extern tree build_continue_stmt (void);
 extern tree build_break_stmt (void);
-extern tree build_return_stmt (tree);
 
 extern void c_expand_asm_operands (tree, tree, tree, tree, int, location_t);
 
@@ -1056,8 +813,6 @@ extern tree default_conversion (tree);
 
 extern tree common_type (tree, tree);
 
-extern tree expand_tree_builtin (tree, tree, tree);
-
 extern tree decl_constant_value (tree);
 
 /* Handle increment and decrement of boolean types.  */
@@ -1085,8 +840,6 @@ extern int vector_types_convertible_p (tree t1, tree t2);
 
 extern rtx c_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
 
-extern int c_safe_from_p (rtx, tree);
-
 extern int c_staticp (tree);
 
 extern int c_common_unsafe_for_reeval (tree);
@@ -1113,22 +866,24 @@ extern void dump_time_statistics (void);
 
 extern bool c_dump_tree (void *, tree);
 
-extern int c_gimplify_expr (tree *, tree *, tree *);
-extern tree c_walk_subtrees (tree*, int*, walk_tree_fn, void*, void*);
-
 extern void c_warn_unused_result (tree *);
 
-/* In c-simplify.c  */
+extern void verify_sequence_points (tree);
+
+/* In c-gimplify.c  */
 extern void c_genericize (tree);
-extern int c_gimplify_stmt (tree *);
+extern int c_gimplify_expr (tree *, tree *, tree *);
 extern tree c_build_bind_expr (tree, tree);
 
+/* In c-pch.c  */
 extern void pch_init (void);
 extern int c_common_valid_pch (cpp_reader *pfile, const char *name, int fd);
 extern void c_common_read_pch (cpp_reader *pfile, const char *name, int fd,
                               const char *orig);
 extern void c_common_write_pch (void);
 extern void c_common_no_more_pch (void);
+extern void c_common_pch_pragma (cpp_reader *pfile);
+
 extern void builtin_define_with_value (const char *, const char *, int);
 extern void c_stddef_cpp_builtins (void);
 extern void fe_file_change (const struct line_map *);