Commit 2f6e4e97 by Andreas Jaeger Committed by Andreas Jaeger

c-lex.c: Convert to ISO C90.


	* c-lex.c: Convert to ISO C90.
	* c-objc-common.c: Likewise.
	* c-opts.c: Likewise.
	* c-pch.c: Likewise.
	* c-ppoutput.c: Likewise.
	* c-pragma.h: Likewise.
	* c-pretty-print.c: Likewise.
	* c-pretty-print.h: Likewise.
	* c-semantics.c: Likewise.
	* c-tree.h: Likewise.
	* c-typeck.c: Likewise.

From-SVN: r68327
parent 3346b668
2003-06-22 Andreas Jaeger <aj@suse.de> 2003-06-22 Andreas Jaeger <aj@suse.de>
* c-lex.c: Convert to ISO C90.
* c-objc-common.c: Likewise.
* c-opts.c: Likewise.
* c-pch.c: Likewise.
* c-ppoutput.c: Likewise.
* c-pragma.h: Likewise.
* c-pretty-print.c: Likewise.
* c-pretty-print.h: Likewise.
* c-semantics.c: Likewise.
* c-tree.h: Likewise.
* c-typeck.c: Likewise.
* c-lang.c: Convert to ISO C90. * c-lang.c: Convert to ISO C90.
2003-06-22 Neil Booth <neil@daikokuya.co.uk> 2003-06-22 Neil Booth <neil@daikokuya.co.uk>
......
...@@ -64,27 +64,24 @@ int c_header_level; /* depth in C headers - C++ only */ ...@@ -64,27 +64,24 @@ int c_header_level; /* depth in C headers - C++ only */
/* Nonzero tells yylex to ignore \ in string constants. */ /* Nonzero tells yylex to ignore \ in string constants. */
static int ignore_escape_flag; static int ignore_escape_flag;
static tree interpret_integer PARAMS ((const cpp_token *, unsigned int)); static tree interpret_integer (const cpp_token *, unsigned int);
static tree interpret_float PARAMS ((const cpp_token *, unsigned int)); static tree interpret_float (const cpp_token *, unsigned int);
static enum integer_type_kind static enum integer_type_kind
narrowest_unsigned_type PARAMS ((tree, unsigned int)); narrowest_unsigned_type (tree, unsigned int);
static enum integer_type_kind static enum integer_type_kind
narrowest_signed_type PARAMS ((tree, unsigned int)); narrowest_signed_type (tree, unsigned int);
static tree lex_string PARAMS ((const cpp_string *)); static tree lex_string (const cpp_string *);
static tree lex_charconst PARAMS ((const cpp_token *)); static tree lex_charconst (const cpp_token *);
static void update_header_times PARAMS ((const char *)); static void update_header_times (const char *);
static int dump_one_header PARAMS ((splay_tree_node, void *)); static int dump_one_header (splay_tree_node, void *);
static void cb_line_change PARAMS ((cpp_reader *, const cpp_token *, int)); static void cb_line_change (cpp_reader *, const cpp_token *, int);
static void cb_ident PARAMS ((cpp_reader *, unsigned int, static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
const cpp_string *)); static void cb_def_pragma (cpp_reader *, unsigned int);
static void cb_def_pragma PARAMS ((cpp_reader *, unsigned int)); static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
static void cb_define PARAMS ((cpp_reader *, unsigned int, static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
cpp_hashnode *));
static void cb_undef PARAMS ((cpp_reader *, unsigned int,
cpp_hashnode *));
void void
init_c_lex () init_c_lex (void)
{ {
struct cpp_callbacks *cb; struct cpp_callbacks *cb;
struct c_fileinfo *toplevel; struct c_fileinfo *toplevel;
...@@ -100,7 +97,7 @@ init_c_lex () ...@@ -100,7 +97,7 @@ init_c_lex ()
body_time = get_run_time (); body_time = get_run_time ();
toplevel->time = body_time; toplevel->time = body_time;
} }
cb = cpp_get_callbacks (parse_in); cb = cpp_get_callbacks (parse_in);
cb->line_change = cb_line_change; cb->line_change = cb_line_change;
...@@ -120,8 +117,7 @@ init_c_lex () ...@@ -120,8 +117,7 @@ init_c_lex ()
} }
struct c_fileinfo * struct c_fileinfo *
get_fileinfo (name) get_fileinfo (const char *name)
const char *name;
{ {
splay_tree_node n; splay_tree_node n;
struct c_fileinfo *fi; struct c_fileinfo *fi;
...@@ -140,8 +136,7 @@ get_fileinfo (name) ...@@ -140,8 +136,7 @@ get_fileinfo (name)
} }
static void static void
update_header_times (name) update_header_times (const char *name)
const char *name;
{ {
/* Changing files again. This means currently collected time /* Changing files again. This means currently collected time
is charged against header time, and body time starts back at 0. */ is charged against header time, and body time starts back at 0. */
...@@ -156,9 +151,7 @@ update_header_times (name) ...@@ -156,9 +151,7 @@ update_header_times (name)
} }
static int static int
dump_one_header (n, dummy) dump_one_header (splay_tree_node n, void *dummy ATTRIBUTE_UNUSED)
splay_tree_node n;
void *dummy ATTRIBUTE_UNUSED;
{ {
print_time ((const char *) n->key, print_time ((const char *) n->key,
((struct c_fileinfo *) n->value)->time); ((struct c_fileinfo *) n->value)->time);
...@@ -166,7 +159,7 @@ dump_one_header (n, dummy) ...@@ -166,7 +159,7 @@ dump_one_header (n, dummy)
} }
void void
dump_time_statistics () dump_time_statistics (void)
{ {
struct c_fileinfo *file = get_fileinfo (input_filename); struct c_fileinfo *file = get_fileinfo (input_filename);
int this_time = get_run_time (); int this_time = get_run_time ();
...@@ -183,10 +176,9 @@ dump_time_statistics () ...@@ -183,10 +176,9 @@ dump_time_statistics ()
} }
static void static void
cb_ident (pfile, line, str) cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED,
cpp_reader *pfile ATTRIBUTE_UNUSED; unsigned int line ATTRIBUTE_UNUSED,
unsigned int line ATTRIBUTE_UNUSED; const cpp_string *str ATTRIBUTE_UNUSED)
const cpp_string *str ATTRIBUTE_UNUSED;
{ {
#ifdef ASM_OUTPUT_IDENT #ifdef ASM_OUTPUT_IDENT
if (! flag_no_ident) if (! flag_no_ident)
...@@ -201,17 +193,14 @@ cb_ident (pfile, line, str) ...@@ -201,17 +193,14 @@ cb_ident (pfile, line, str)
/* Called at the start of every non-empty line. TOKEN is the first /* Called at the start of every non-empty line. TOKEN is the first
lexed token on the line. Used for diagnostic line numbers. */ lexed token on the line. Used for diagnostic line numbers. */
static void static void
cb_line_change (pfile, token, parsing_args) cb_line_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const cpp_token *token,
cpp_reader *pfile ATTRIBUTE_UNUSED; int parsing_args ATTRIBUTE_UNUSED)
const cpp_token *token;
int parsing_args ATTRIBUTE_UNUSED;
{ {
src_lineno = SOURCE_LINE (map, token->line); src_lineno = SOURCE_LINE (map, token->line);
} }
void void
fe_file_change (new_map) fe_file_change (const struct line_map *new_map)
const struct line_map *new_map;
{ {
unsigned int to_line = SOURCE_LINE (new_map, new_map->to_line); unsigned int to_line = SOURCE_LINE (new_map, new_map->to_line);
...@@ -250,7 +239,7 @@ fe_file_change (new_map) ...@@ -250,7 +239,7 @@ fe_file_change (new_map)
} }
#endif #endif
pop_srcloc (); pop_srcloc ();
(*debug_hooks->end_source_file) (to_line); (*debug_hooks->end_source_file) (to_line);
} }
...@@ -265,9 +254,7 @@ fe_file_change (new_map) ...@@ -265,9 +254,7 @@ fe_file_change (new_map)
} }
static void static void
cb_def_pragma (pfile, line) cb_def_pragma (cpp_reader *pfile, unsigned int line)
cpp_reader *pfile;
unsigned int line;
{ {
/* Issue a warning message if we have been asked to do so. Ignore /* Issue a warning message if we have been asked to do so. Ignore
unknown pragmas in system headers unless an explicit unknown pragmas in system headers unless an explicit
...@@ -294,10 +281,7 @@ cb_def_pragma (pfile, line) ...@@ -294,10 +281,7 @@ cb_def_pragma (pfile, line)
/* #define callback for DWARF and DWARF2 debug info. */ /* #define callback for DWARF and DWARF2 debug info. */
static void static void
cb_define (pfile, line, node) cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
cpp_reader *pfile;
unsigned int line;
cpp_hashnode *node;
{ {
(*debug_hooks->define) (SOURCE_LINE (map, line), (*debug_hooks->define) (SOURCE_LINE (map, line),
(const char *) cpp_macro_definition (pfile, node)); (const char *) cpp_macro_definition (pfile, node));
...@@ -305,18 +289,15 @@ cb_define (pfile, line, node) ...@@ -305,18 +289,15 @@ cb_define (pfile, line, node)
/* #undef callback for DWARF and DWARF2 debug info. */ /* #undef callback for DWARF and DWARF2 debug info. */
static void static void
cb_undef (pfile, line, node) cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; cpp_hashnode *node)
unsigned int line;
cpp_hashnode *node;
{ {
(*debug_hooks->undef) (SOURCE_LINE (map, line), (*debug_hooks->undef) (SOURCE_LINE (map, line),
(const char *) NODE_NAME (node)); (const char *) NODE_NAME (node));
} }
int int
c_lex (value) c_lex (tree *value)
tree *value;
{ {
const cpp_token *tok; const cpp_token *tok;
...@@ -403,9 +384,7 @@ c_lex (value) ...@@ -403,9 +384,7 @@ c_lex (value)
minimum specified by FLAGS, that can fit VALUE, or itk_none if minimum specified by FLAGS, that can fit VALUE, or itk_none if
there isn't one. */ there isn't one. */
static enum integer_type_kind static enum integer_type_kind
narrowest_unsigned_type (value, flags) narrowest_unsigned_type (tree value, unsigned int flags)
tree value;
unsigned int flags;
{ {
enum integer_type_kind itk; enum integer_type_kind itk;
...@@ -429,9 +408,7 @@ narrowest_unsigned_type (value, flags) ...@@ -429,9 +408,7 @@ narrowest_unsigned_type (value, flags)
/* Ditto, but narrowest signed type. */ /* Ditto, but narrowest signed type. */
static enum integer_type_kind static enum integer_type_kind
narrowest_signed_type (value, flags) narrowest_signed_type (tree value, unsigned int flags)
tree value;
unsigned int flags;
{ {
enum integer_type_kind itk; enum integer_type_kind itk;
...@@ -455,9 +432,7 @@ narrowest_signed_type (value, flags) ...@@ -455,9 +432,7 @@ narrowest_signed_type (value, flags)
/* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */ /* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */
static tree static tree
interpret_integer (token, flags) interpret_integer (const cpp_token *token, unsigned int flags)
const cpp_token *token;
unsigned int flags;
{ {
tree value, type; tree value, type;
enum integer_type_kind itk; enum integer_type_kind itk;
...@@ -535,9 +510,7 @@ interpret_integer (token, flags) ...@@ -535,9 +510,7 @@ interpret_integer (token, flags)
/* Interpret TOKEN, a floating point number with FLAGS as classified /* Interpret TOKEN, a floating point number with FLAGS as classified
by cpplib. */ by cpplib. */
static tree static tree
interpret_float (token, flags) interpret_float (const cpp_token *token, unsigned int flags)
const cpp_token *token;
unsigned int flags;
{ {
tree type; tree type;
tree value; tree value;
...@@ -599,15 +572,14 @@ interpret_float (token, flags) ...@@ -599,15 +572,14 @@ interpret_float (token, flags)
} }
static tree static tree
lex_string (str) lex_string (const cpp_string *str)
const cpp_string *str;
{ {
bool wide; bool wide;
tree value; tree value;
char *buf, *q; char *buf, *q;
cppchar_t c; cppchar_t c;
const unsigned char *p, *limit; const unsigned char *p, *limit;
wide = str->text[0] == 'L'; wide = str->text[0] == 'L';
p = str->text + 1 + wide; p = str->text + 1 + wide;
limit = str->text + str->len - 1; limit = str->text + str->len - 1;
...@@ -619,7 +591,7 @@ lex_string (str) ...@@ -619,7 +591,7 @@ lex_string (str)
if (c == '\\' && !ignore_escape_flag) if (c == '\\' && !ignore_escape_flag)
c = cpp_parse_escape (parse_in, &p, limit, wide); c = cpp_parse_escape (parse_in, &p, limit, wide);
/* Add this single character into the buffer either as a wchar_t, /* Add this single character into the buffer either as a wchar_t,
a multibyte sequence, or as a single byte. */ a multibyte sequence, or as a single byte. */
if (wide) if (wide)
...@@ -672,8 +644,7 @@ lex_string (str) ...@@ -672,8 +644,7 @@ lex_string (str)
/* Converts a (possibly wide) character constant token into a tree. */ /* Converts a (possibly wide) character constant token into a tree. */
static tree static tree
lex_charconst (token) lex_charconst (const cpp_token *token)
const cpp_token *token;
{ {
cppchar_t result; cppchar_t result;
tree type, value; tree type, value;
...@@ -681,7 +652,7 @@ lex_charconst (token) ...@@ -681,7 +652,7 @@ lex_charconst (token)
int unsignedp; int unsignedp;
result = cpp_interpret_charconst (parse_in, token, result = cpp_interpret_charconst (parse_in, token,
&chars_seen, &unsignedp); &chars_seen, &unsignedp);
/* Cast to cppchar_signed_t to get correct sign-extension of RESULT /* Cast to cppchar_signed_t to get correct sign-extension of RESULT
before possibly widening to HOST_WIDE_INT for build_int_2. */ before possibly widening to HOST_WIDE_INT for build_int_2. */
......
/* Some code common to C and ObjC front ends. /* Some code common to C and ObjC front ends.
Copyright (C) 2001, 2002 Free Software Foundation, Inc. Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -39,17 +39,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -39,17 +39,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "target.h" #include "target.h"
#include "cgraph.h" #include "cgraph.h"
static bool c_tree_printer PARAMS ((output_buffer *, text_info *)); static bool c_tree_printer (output_buffer *, text_info *);
static tree inline_forbidden_p PARAMS ((tree *, int *, void *)); static tree inline_forbidden_p (tree *, int *, void *);
static void expand_deferred_fns PARAMS ((void)); static void expand_deferred_fns (void);
static tree start_cdtor PARAMS ((int)); static tree start_cdtor (int);
static void finish_cdtor PARAMS ((tree)); static void finish_cdtor (tree);
static GTY(()) varray_type deferred_fns; static GTY(()) varray_type deferred_fns;
int int
c_missing_noreturn_ok_p (decl) c_missing_noreturn_ok_p (tree decl)
tree decl;
{ {
/* A missing noreturn is not ok for freestanding implementations and /* A missing noreturn is not ok for freestanding implementations and
ok for the `main' function in hosted implementations. */ ok for the `main' function in hosted implementations. */
...@@ -61,8 +60,7 @@ c_missing_noreturn_ok_p (decl) ...@@ -61,8 +60,7 @@ c_missing_noreturn_ok_p (decl)
such functions always being inlined when optimizing. */ such functions always being inlined when optimizing. */
int int
c_disregard_inline_limits (fn) c_disregard_inline_limits (tree fn)
tree fn;
{ {
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL) if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
return 1; return 1;
...@@ -71,10 +69,8 @@ c_disregard_inline_limits (fn) ...@@ -71,10 +69,8 @@ c_disregard_inline_limits (fn)
} }
static tree static tree
inline_forbidden_p (nodep, walk_subtrees, fn) inline_forbidden_p (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
tree *nodep; void *fn)
int *walk_subtrees ATTRIBUTE_UNUSED;
void *fn;
{ {
tree node = *nodep; tree node = *nodep;
tree t; tree t;
...@@ -160,8 +156,7 @@ inline_forbidden_p (nodep, walk_subtrees, fn) ...@@ -160,8 +156,7 @@ inline_forbidden_p (nodep, walk_subtrees, fn)
} }
int int
c_cannot_inline_tree_fn (fnp) c_cannot_inline_tree_fn (tree *fnp)
tree *fnp;
{ {
tree fn = *fnp; tree fn = *fnp;
tree t; tree t;
...@@ -170,7 +165,7 @@ c_cannot_inline_tree_fn (fnp) ...@@ -170,7 +165,7 @@ c_cannot_inline_tree_fn (fnp)
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
return 1; return 1;
/* Don't auto-inline anything that might not be bound within /* Don't auto-inline anything that might not be bound within
this unit of translation. */ this unit of translation. */
if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn)) if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn))
goto cannot_inline; goto cannot_inline;
...@@ -215,7 +210,7 @@ c_cannot_inline_tree_fn (fnp) ...@@ -215,7 +210,7 @@ c_cannot_inline_tree_fn (fnp)
if (! t) if (! t)
return 0; return 0;
} }
if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL)) if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL))
goto cannot_inline; goto cannot_inline;
...@@ -229,8 +224,7 @@ c_cannot_inline_tree_fn (fnp) ...@@ -229,8 +224,7 @@ c_cannot_inline_tree_fn (fnp)
/* Called from check_global_declarations. */ /* Called from check_global_declarations. */
bool bool
c_warn_unused_global_decl (decl) c_warn_unused_global_decl (tree decl)
tree decl;
{ {
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl)) if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
return false; return false;
...@@ -242,7 +236,7 @@ c_warn_unused_global_decl (decl) ...@@ -242,7 +236,7 @@ c_warn_unused_global_decl (decl)
/* Initialization common to C and Objective-C front ends. */ /* Initialization common to C and Objective-C front ends. */
bool bool
c_objc_common_init () c_objc_common_init (void)
{ {
static const enum tree_code stmt_codes[] = { static const enum tree_code stmt_codes[] = {
c_common_stmt_codes c_common_stmt_codes
...@@ -282,8 +276,7 @@ c_objc_common_init () ...@@ -282,8 +276,7 @@ c_objc_common_init ()
to RTL is only done at the end of the compilation. */ to RTL is only done at the end of the compilation. */
int int
defer_fn (fn) defer_fn (tree fn)
tree fn;
{ {
VARRAY_PUSH_TREE (deferred_fns, fn); VARRAY_PUSH_TREE (deferred_fns, fn);
...@@ -293,7 +286,7 @@ defer_fn (fn) ...@@ -293,7 +286,7 @@ defer_fn (fn)
/* Expand deferred functions for C and ObjC. */ /* Expand deferred functions for C and ObjC. */
static void static void
expand_deferred_fns () expand_deferred_fns (void)
{ {
unsigned int i; unsigned int i;
...@@ -315,8 +308,7 @@ expand_deferred_fns () ...@@ -315,8 +308,7 @@ expand_deferred_fns ()
} }
static tree static tree
start_cdtor (method_type) start_cdtor (int method_type)
int method_type;
{ {
tree fnname = get_file_function_name (method_type); tree fnname = get_file_function_name (method_type);
tree void_list_node_1 = build_tree_list (NULL_TREE, void_type_node); tree void_list_node_1 = build_tree_list (NULL_TREE, void_type_node);
...@@ -342,8 +334,7 @@ start_cdtor (method_type) ...@@ -342,8 +334,7 @@ start_cdtor (method_type)
} }
static void static void
finish_cdtor (body) finish_cdtor (tree body)
tree body;
{ {
tree scope; tree scope;
tree block; tree block;
...@@ -361,7 +352,7 @@ finish_cdtor (body) ...@@ -361,7 +352,7 @@ finish_cdtor (body)
/* Called at end of parsing, but before end-of-file processing. */ /* Called at end of parsing, but before end-of-file processing. */
void void
c_objc_common_finish_file () c_objc_common_finish_file (void)
{ {
if (pch_file) if (pch_file)
c_common_write_pch (); c_common_write_pch ();
...@@ -420,9 +411,7 @@ c_objc_common_finish_file () ...@@ -420,9 +411,7 @@ c_objc_common_finish_file ()
Please notice when called, the `%' part was already skipped by the Please notice when called, the `%' part was already skipped by the
diagnostic machinery. */ diagnostic machinery. */
static bool static bool
c_tree_printer (buffer, text) c_tree_printer (output_buffer *buffer, text_info *text)
output_buffer *buffer;
text_info *text;
{ {
tree t = va_arg (*text->args_ptr, tree); tree t = va_arg (*text->args_ptr, tree);
......
...@@ -100,22 +100,22 @@ static size_t deferred_count, deferred_size; ...@@ -100,22 +100,22 @@ static size_t deferred_count, deferred_size;
/* Number of deferred options scanned for -include. */ /* Number of deferred options scanned for -include. */
static size_t include_cursor; static size_t include_cursor;
static void missing_arg PARAMS ((enum opt_code)); static void missing_arg (enum opt_code);
static void set_Wimplicit PARAMS ((int)); static void set_Wimplicit (int);
static void complain_wrong_lang PARAMS ((size_t, int)); static void complain_wrong_lang (size_t, int);
static void write_langs PARAMS ((char *, int)); static void write_langs (char *, int);
static void print_help PARAMS ((void)); static void print_help (void);
static void handle_OPT_d PARAMS ((const char *)); static void handle_OPT_d (const char *);
static void set_std_cxx98 PARAMS ((int)); static void set_std_cxx98 (int);
static void set_std_c89 PARAMS ((int, int)); static void set_std_c89 (int, int);
static void set_std_c99 PARAMS ((int)); static void set_std_c99 (int);
static void check_deps_environment_vars PARAMS ((void)); static void check_deps_environment_vars (void);
static void handle_deferred_opts PARAMS ((void)); static void handle_deferred_opts (void);
static void sanitize_cpp_opts PARAMS ((void)); static void sanitize_cpp_opts (void);
static void add_prefixed_path PARAMS ((const char *, size_t)); static void add_prefixed_path (const char *, size_t);
static void push_command_line_include PARAMS ((void)); static void push_command_line_include (void);
static void cb_file_change PARAMS ((cpp_reader *, const struct line_map *)); static void cb_file_change (cpp_reader *, const struct line_map *);
static void finish_options PARAMS ((void)); static void finish_options (void);
#ifndef STDC_0_IN_SYSTEM_HEADERS #ifndef STDC_0_IN_SYSTEM_HEADERS
#define STDC_0_IN_SYSTEM_HEADERS 0 #define STDC_0_IN_SYSTEM_HEADERS 0
...@@ -123,7 +123,7 @@ static void finish_options PARAMS ((void)); ...@@ -123,7 +123,7 @@ static void finish_options PARAMS ((void));
/* Holds switches parsed by c_common_handle_option (), but whose /* Holds switches parsed by c_common_handle_option (), but whose
handling is deferred to c_common_post_options (). */ handling is deferred to c_common_post_options (). */
static void defer_opt PARAMS ((enum opt_code, const char *)); static void defer_opt (enum opt_code, const char *);
static struct deferred_opt static struct deferred_opt
{ {
enum opt_code code; enum opt_code code;
...@@ -193,9 +193,7 @@ missing_arg (enum opt_code code) ...@@ -193,9 +193,7 @@ missing_arg (enum opt_code code)
/* Defer option CODE with argument ARG. */ /* Defer option CODE with argument ARG. */
static void static void
defer_opt (code, arg) defer_opt (enum opt_code code, const char *arg)
enum opt_code code;
const char *arg;
{ {
/* FIXME: this should be in c_common_init_options, which should take /* FIXME: this should be in c_common_init_options, which should take
argc and argv. */ argc and argv. */
...@@ -217,8 +215,7 @@ defer_opt (code, arg) ...@@ -217,8 +215,7 @@ defer_opt (code, arg)
/* Common initialization before parsing options. */ /* Common initialization before parsing options. */
int int
c_common_init_options (lang) c_common_init_options (enum c_language_kind lang)
enum c_language_kind lang;
{ {
c_language = lang; c_language = lang;
parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX, parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX,
...@@ -388,9 +385,9 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -388,9 +385,9 @@ c_common_handle_option (size_t scode, const char *arg, int value)
warn_sign_compare = value; warn_sign_compare = value;
warn_switch = value; warn_switch = value;
warn_strict_aliasing = value; warn_strict_aliasing = value;
/* Only warn about unknown pragmas that are not in system /* Only warn about unknown pragmas that are not in system
headers. */ headers. */
warn_unknown_pragmas = value; warn_unknown_pragmas = value;
/* We save the value of warn_uninitialized, since if they put /* We save the value of warn_uninitialized, since if they put
...@@ -653,7 +650,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -653,7 +650,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_Wunknown_pragmas: case OPT_Wunknown_pragmas:
/* Set to greater than 1, so that even unknown pragmas in /* Set to greater than 1, so that even unknown pragmas in
system headers will be warned about. */ system headers will be warned about. */
warn_unknown_pragmas = value * 2; warn_unknown_pragmas = value * 2;
break; break;
...@@ -667,7 +664,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -667,7 +664,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
else else
warn_write_strings = value; warn_write_strings = value;
break; break;
case OPT_ansi: case OPT_ansi:
if (c_language == clk_c) if (c_language == clk_c)
set_std_c89 (false, true); set_std_c89 (false, true);
...@@ -1054,8 +1051,7 @@ c_common_handle_option (size_t scode, const char *arg, int value) ...@@ -1054,8 +1051,7 @@ c_common_handle_option (size_t scode, const char *arg, int value)
/* Post-switch processing. */ /* Post-switch processing. */
bool bool
c_common_post_options (pfilename) c_common_post_options (const char **pfilename)
const char **pfilename;
{ {
/* Canonicalize the input and output filenames. */ /* Canonicalize the input and output filenames. */
if (in_fname == NULL || !strcmp (in_fname, "-")) if (in_fname == NULL || !strcmp (in_fname, "-"))
...@@ -1153,7 +1149,7 @@ c_common_post_options (pfilename) ...@@ -1153,7 +1149,7 @@ c_common_post_options (pfilename)
/* Front end initialization common to C, ObjC and C++. */ /* Front end initialization common to C, ObjC and C++. */
bool bool
c_common_init () c_common_init (void)
{ {
input_line = saved_lineno; input_line = saved_lineno;
...@@ -1179,13 +1175,12 @@ c_common_init () ...@@ -1179,13 +1175,12 @@ c_common_init ()
return true; return true;
} }
/* A thin wrapper around the real parser that initializes the /* A thin wrapper around the real parser that initializes the
integrated preprocessor after debug output has been initialized. integrated preprocessor after debug output has been initialized.
Also, make sure the start_source_file debug hook gets called for Also, make sure the start_source_file debug hook gets called for
the primary source file. */ the primary source file. */
void void
c_common_parse_file (set_yydebug) c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
int set_yydebug ATTRIBUTE_UNUSED;
{ {
#if YYDEBUG != 0 #if YYDEBUG != 0
yydebug = set_yydebug; yydebug = set_yydebug;
...@@ -1202,7 +1197,7 @@ c_common_parse_file (set_yydebug) ...@@ -1202,7 +1197,7 @@ c_common_parse_file (set_yydebug)
/* Common finish hook for the C, ObjC and C++ front ends. */ /* Common finish hook for the C, ObjC and C++ front ends. */
void void
c_common_finish () c_common_finish (void)
{ {
FILE *deps_stream = NULL; FILE *deps_stream = NULL;
...@@ -1240,7 +1235,7 @@ c_common_finish () ...@@ -1240,7 +1235,7 @@ c_common_finish ()
rather than overwriting it, and like Sun's compiler rather than overwriting it, and like Sun's compiler
SUNPRO_DEPENDENCIES suppresses the dependency on the main file. */ SUNPRO_DEPENDENCIES suppresses the dependency on the main file. */
static void static void
check_deps_environment_vars () check_deps_environment_vars (void)
{ {
char *spec; char *spec;
...@@ -1278,7 +1273,7 @@ check_deps_environment_vars () ...@@ -1278,7 +1273,7 @@ check_deps_environment_vars ()
/* Handle deferred command line switches. */ /* Handle deferred command line switches. */
static void static void
handle_deferred_opts () handle_deferred_opts (void)
{ {
size_t i; size_t i;
...@@ -1294,7 +1289,7 @@ handle_deferred_opts () ...@@ -1294,7 +1289,7 @@ handle_deferred_opts ()
/* These settings are appropriate for GCC, but not necessarily so for /* These settings are appropriate for GCC, but not necessarily so for
cpplib as a library. */ cpplib as a library. */
static void static void
sanitize_cpp_opts () sanitize_cpp_opts (void)
{ {
/* If we don't know what style of dependencies to output, complain /* If we don't know what style of dependencies to output, complain
if any other dependency switches have been given. */ if any other dependency switches have been given. */
...@@ -1326,9 +1321,7 @@ sanitize_cpp_opts () ...@@ -1326,9 +1321,7 @@ sanitize_cpp_opts ()
/* Add include path with a prefix at the front of its name. */ /* Add include path with a prefix at the front of its name. */
static void static void
add_prefixed_path (suffix, chain) add_prefixed_path (const char *suffix, size_t chain)
const char *suffix;
size_t chain;
{ {
char *path; char *path;
const char *prefix; const char *prefix;
...@@ -1348,7 +1341,7 @@ add_prefixed_path (suffix, chain) ...@@ -1348,7 +1341,7 @@ add_prefixed_path (suffix, chain)
/* Handle -D, -U, -A, -imacros, and the first -include. */ /* Handle -D, -U, -A, -imacros, and the first -include. */
static void static void
finish_options () finish_options (void)
{ {
if (!cpp_opts->preprocessed) if (!cpp_opts->preprocessed)
{ {
...@@ -1403,15 +1396,15 @@ finish_options () ...@@ -1403,15 +1396,15 @@ finish_options ()
/* Give CPP the next file given by -include, if any. */ /* Give CPP the next file given by -include, if any. */
static void static void
push_command_line_include () push_command_line_include (void)
{ {
if (cpp_opts->preprocessed) if (cpp_opts->preprocessed)
return; return;
while (include_cursor < deferred_count) while (include_cursor < deferred_count)
{ {
struct deferred_opt *opt = &deferred_opts[include_cursor++]; struct deferred_opt *opt = &deferred_opts[include_cursor++];
if (opt->code == OPT_include && cpp_push_include (parse_in, opt->arg)) if (opt->code == OPT_include && cpp_push_include (parse_in, opt->arg))
return; return;
} }
...@@ -1428,9 +1421,8 @@ push_command_line_include () ...@@ -1428,9 +1421,8 @@ push_command_line_include ()
/* File change callback. Has to handle -include files. */ /* File change callback. Has to handle -include files. */
static void static void
cb_file_change (pfile, new_map) cb_file_change (cpp_reader *pfile ATTRIBUTE_UNUSED,
cpp_reader *pfile ATTRIBUTE_UNUSED; const struct line_map *new_map)
const struct line_map *new_map;
{ {
if (flag_preprocess_only) if (flag_preprocess_only)
pp_file_change (new_map); pp_file_change (new_map);
...@@ -1444,8 +1436,7 @@ cb_file_change (pfile, new_map) ...@@ -1444,8 +1436,7 @@ cb_file_change (pfile, new_map)
/* Set the C 89 standard (with 1994 amendments if C94, without GNU /* Set the C 89 standard (with 1994 amendments if C94, without GNU
extensions if ISO). There is no concept of gnu94. */ extensions if ISO). There is no concept of gnu94. */
static void static void
set_std_c89 (c94, iso) set_std_c89 (int c94, int iso)
int c94, iso;
{ {
cpp_set_lang (parse_in, c94 ? CLK_STDC94: iso ? CLK_STDC89: CLK_GNUC89); cpp_set_lang (parse_in, c94 ? CLK_STDC94: iso ? CLK_STDC89: CLK_GNUC89);
flag_iso = iso; flag_iso = iso;
...@@ -1460,8 +1451,7 @@ set_std_c89 (c94, iso) ...@@ -1460,8 +1451,7 @@ set_std_c89 (c94, iso)
/* Set the C 99 standard (without GNU extensions if ISO). */ /* Set the C 99 standard (without GNU extensions if ISO). */
static void static void
set_std_c99 (iso) set_std_c99 (int iso)
int iso;
{ {
cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99); cpp_set_lang (parse_in, iso ? CLK_STDC99: CLK_GNUC99);
flag_no_asm = iso; flag_no_asm = iso;
...@@ -1475,8 +1465,7 @@ set_std_c99 (iso) ...@@ -1475,8 +1465,7 @@ set_std_c99 (iso)
/* Set the C++ 98 standard (without GNU extensions if ISO). */ /* Set the C++ 98 standard (without GNU extensions if ISO). */
static void static void
set_std_cxx98 (iso) set_std_cxx98 (int iso)
int iso;
{ {
cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX); cpp_set_lang (parse_in, iso ? CLK_CXX98: CLK_GNUCXX);
flag_no_gnu_keywords = iso; flag_no_gnu_keywords = iso;
...@@ -1487,8 +1476,7 @@ set_std_cxx98 (iso) ...@@ -1487,8 +1476,7 @@ set_std_cxx98 (iso)
/* Handle setting implicit to ON. */ /* Handle setting implicit to ON. */
static void static void
set_Wimplicit (on) set_Wimplicit (int on)
int on;
{ {
warn_implicit = on; warn_implicit = on;
warn_implicit_int = on; warn_implicit_int = on;
...@@ -1504,8 +1492,7 @@ set_Wimplicit (on) ...@@ -1504,8 +1492,7 @@ set_Wimplicit (on)
/* Args to -d specify what to dump. Silently ignore /* Args to -d specify what to dump. Silently ignore
unrecognized options; they may be aimed at toplev.c. */ unrecognized options; they may be aimed at toplev.c. */
static void static void
handle_OPT_d (arg) handle_OPT_d (const char *arg)
const char *arg;
{ {
char c; char c;
...@@ -1526,9 +1513,7 @@ handle_OPT_d (arg) ...@@ -1526,9 +1513,7 @@ handle_OPT_d (arg)
/* Write a slash-separated list of languages in FLAGS to BUF. */ /* Write a slash-separated list of languages in FLAGS to BUF. */
static void static void
write_langs (buf, flags) write_langs (char *buf, int flags)
char *buf;
int flags;
{ {
*buf = '\0'; *buf = '\0';
if (flags & CL_C) if (flags & CL_C)
...@@ -1549,9 +1534,7 @@ write_langs (buf, flags) ...@@ -1549,9 +1534,7 @@ write_langs (buf, flags)
/* Complain that switch OPT_INDEX does not apply to this front end. */ /* Complain that switch OPT_INDEX does not apply to this front end. */
static void static void
complain_wrong_lang (opt_index, on) complain_wrong_lang (size_t opt_index, int on)
size_t opt_index;
int on;
{ {
char ok_langs[60], bad_langs[60]; char ok_langs[60], bad_langs[60];
int ok_flags = cl_options[opt_index].flags; int ok_flags = cl_options[opt_index].flags;
...@@ -1566,7 +1549,7 @@ complain_wrong_lang (opt_index, on) ...@@ -1566,7 +1549,7 @@ complain_wrong_lang (opt_index, on)
/* Handle --help output. */ /* Handle --help output. */
static void static void
print_help () print_help (void)
{ {
/* To keep the lines from getting too long for some compilers, limit /* To keep the lines from getting too long for some compilers, limit
to about 500 characters (6 lines) per chunk. */ to about 500 characters (6 lines) per chunk. */
......
/* Precompiled header implementation for the C languages. /* Precompiled header implementation for the C languages.
Copyright (C) 2000, 2002 Free Software Foundation, Inc. Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC. This file is part of GCC.
...@@ -48,7 +48,7 @@ static FILE *pch_outfile; ...@@ -48,7 +48,7 @@ static FILE *pch_outfile;
static long asm_file_startpos; static long asm_file_startpos;
static const char * get_ident PARAMS((void)); static const char *get_ident (void);
/* Compute an appropriate 8-byte magic number for the PCH file, so that /* Compute an appropriate 8-byte magic number for the PCH file, so that
utilities like file(1) can identify it, and so that GCC can quickly utilities like file(1) can identify it, and so that GCC can quickly
...@@ -56,7 +56,7 @@ static const char * get_ident PARAMS((void)); ...@@ -56,7 +56,7 @@ static const char * get_ident PARAMS((void));
format. */ format. */
static const char * static const char *
get_ident() get_ident(void)
{ {
static char result[IDENT_LENGTH]; static char result[IDENT_LENGTH];
static const char template[IDENT_LENGTH] = "gpch.011"; static const char template[IDENT_LENGTH] = "gpch.011";
...@@ -75,7 +75,7 @@ get_ident() ...@@ -75,7 +75,7 @@ get_ident()
compilation. */ compilation. */
void void
pch_init () pch_init (void)
{ {
FILE *f; FILE *f;
struct c_pch_validity v; struct c_pch_validity v;
...@@ -111,7 +111,7 @@ pch_init () ...@@ -111,7 +111,7 @@ pch_init ()
will produce a PCH file. */ will produce a PCH file. */
void void
c_common_write_pch () c_common_write_pch (void)
{ {
char *buf; char *buf;
long asm_file_end; long asm_file_end;
...@@ -157,10 +157,7 @@ c_common_write_pch () ...@@ -157,10 +157,7 @@ c_common_write_pch ()
in this compilation. */ in this compilation. */
int int
c_common_valid_pch (pfile, name, fd) c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
cpp_reader *pfile;
const char *name;
int fd;
{ {
int sizeread; int sizeread;
int result; int result;
...@@ -232,11 +229,8 @@ c_common_valid_pch (pfile, name, fd) ...@@ -232,11 +229,8 @@ c_common_valid_pch (pfile, name, fd)
by ORIG_NAME. */ by ORIG_NAME. */
void void
c_common_read_pch (pfile, name, fd, orig_name) c_common_read_pch (cpp_reader *pfile, const char *name,
cpp_reader *pfile; int fd, const char *orig_name ATTRIBUTE_UNUSED)
const char *name;
int fd;
const char *orig_name ATTRIBUTE_UNUSED;
{ {
FILE *f; FILE *f;
struct c_pch_header h; struct c_pch_header h;
......
...@@ -40,30 +40,28 @@ static struct ...@@ -40,30 +40,28 @@ static struct
} print; } print;
/* General output routines. */ /* General output routines. */
static void scan_translation_unit PARAMS ((cpp_reader *)); static void scan_translation_unit (cpp_reader *);
static void scan_translation_unit_trad PARAMS ((cpp_reader *)); static void scan_translation_unit_trad (cpp_reader *);
static void account_for_newlines PARAMS ((const uchar *, size_t)); static void account_for_newlines (const uchar *, size_t);
static int dump_macro PARAMS ((cpp_reader *, cpp_hashnode *, void *)); static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
static void print_line PARAMS ((const struct line_map *, unsigned int, static void print_line (const struct line_map *, unsigned int,
const char *)); const char *);
static void maybe_print_line PARAMS ((const struct line_map *, unsigned int)); static void maybe_print_line (const struct line_map *, unsigned int);
/* Callback routines for the parser. Most of these are active only /* Callback routines for the parser. Most of these are active only
in specific modes. */ in specific modes. */
static void cb_line_change PARAMS ((cpp_reader *, const cpp_token *, int)); static void cb_line_change (cpp_reader *, const cpp_token *, int);
static void cb_define PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *)); static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
static void cb_undef PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *)); static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
static void cb_include PARAMS ((cpp_reader *, unsigned int, static void cb_include (cpp_reader *, unsigned int, const unsigned char *,
const unsigned char *, const char *, int)); const char *, int);
static void cb_ident PARAMS ((cpp_reader *, unsigned int, static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
const cpp_string *)); static void cb_def_pragma (cpp_reader *, unsigned int);
static void cb_def_pragma PARAMS ((cpp_reader *, unsigned int));
/* Preprocess and output. */ /* Preprocess and output. */
void void
preprocess_file (pfile) preprocess_file (cpp_reader *pfile)
cpp_reader *pfile;
{ {
/* A successful cpp_read_main_file guarantees that we can call /* A successful cpp_read_main_file guarantees that we can call
cpp_scan_nooutput or cpp_get_token next. */ cpp_scan_nooutput or cpp_get_token next. */
...@@ -90,8 +88,7 @@ preprocess_file (pfile) ...@@ -90,8 +88,7 @@ preprocess_file (pfile)
/* Set up the callbacks as appropriate. */ /* Set up the callbacks as appropriate. */
void void
init_pp_output (out_stream) init_pp_output (FILE *out_stream)
FILE *out_stream;
{ {
cpp_callbacks *cb = cpp_get_callbacks (parse_in); cpp_callbacks *cb = cpp_get_callbacks (parse_in);
...@@ -129,8 +126,7 @@ init_pp_output (out_stream) ...@@ -129,8 +126,7 @@ init_pp_output (out_stream)
/* Writes out the preprocessed file, handling spacing and paste /* Writes out the preprocessed file, handling spacing and paste
avoidance issues. */ avoidance issues. */
static void static void
scan_translation_unit (pfile) scan_translation_unit (cpp_reader *pfile)
cpp_reader *pfile;
{ {
bool avoid_paste = false; bool avoid_paste = false;
...@@ -178,9 +174,7 @@ scan_translation_unit (pfile) ...@@ -178,9 +174,7 @@ scan_translation_unit (pfile)
/* Adjust print.line for newlines embedded in output. */ /* Adjust print.line for newlines embedded in output. */
static void static void
account_for_newlines (str, len) account_for_newlines (const uchar *str, size_t len)
const uchar *str;
size_t len;
{ {
while (len--) while (len--)
if (*str++ == '\n') if (*str++ == '\n')
...@@ -189,8 +183,7 @@ account_for_newlines (str, len) ...@@ -189,8 +183,7 @@ account_for_newlines (str, len)
/* Writes out a traditionally preprocessed file. */ /* Writes out a traditionally preprocessed file. */
static void static void
scan_translation_unit_trad (pfile) scan_translation_unit_trad (cpp_reader *pfile)
cpp_reader *pfile;
{ {
while (_cpp_read_logical_line_trad (pfile)) while (_cpp_read_logical_line_trad (pfile))
{ {
...@@ -207,9 +200,7 @@ scan_translation_unit_trad (pfile) ...@@ -207,9 +200,7 @@ scan_translation_unit_trad (pfile)
different line to the current one, output the required newlines or different line to the current one, output the required newlines or
a line marker, and return 1. Otherwise return 0. */ a line marker, and return 1. Otherwise return 0. */
static void static void
maybe_print_line (map, line) maybe_print_line (const struct line_map *map, unsigned int line)
const struct line_map *map;
unsigned int line;
{ {
/* End the previous line of text. */ /* End the previous line of text. */
if (print.printed) if (print.printed)
...@@ -234,10 +225,7 @@ maybe_print_line (map, line) ...@@ -234,10 +225,7 @@ maybe_print_line (map, line)
/* Output a line marker for logical line LINE. Special flags are "1" /* Output a line marker for logical line LINE. Special flags are "1"
or "2" indicating entering or leaving a file. */ or "2" indicating entering or leaving a file. */
static void static void
print_line (map, line, special_flags) print_line (const struct line_map *map, unsigned int line, const char *special_flags)
const struct line_map *map;
unsigned int line;
const char *special_flags;
{ {
/* End any previous line of text. */ /* End any previous line of text. */
if (print.printed) if (print.printed)
...@@ -272,10 +260,7 @@ print_line (map, line, special_flags) ...@@ -272,10 +260,7 @@ print_line (map, line, special_flags)
/* Called when a line of output is started. TOKEN is the first token /* Called when a line of output is started. TOKEN is the first token
of the line, and at end of file will be CPP_EOF. */ of the line, and at end of file will be CPP_EOF. */
static void static void
cb_line_change (pfile, token, parsing_args) cb_line_change (cpp_reader *pfile, const cpp_token *token, int parsing_args)
cpp_reader *pfile;
const cpp_token *token;
int parsing_args;
{ {
if (token->type == CPP_EOF || parsing_args) if (token->type == CPP_EOF || parsing_args)
return; return;
...@@ -303,10 +288,8 @@ cb_line_change (pfile, token, parsing_args) ...@@ -303,10 +288,8 @@ cb_line_change (pfile, token, parsing_args)
} }
static void static void
cb_ident (pfile, line, str) cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; const cpp_string *str)
unsigned int line;
const cpp_string * str;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fprintf (print.outf, "#ident \"%s\"\n", str->text); fprintf (print.outf, "#ident \"%s\"\n", str->text);
...@@ -314,10 +297,7 @@ cb_ident (pfile, line, str) ...@@ -314,10 +297,7 @@ cb_ident (pfile, line, str)
} }
static void static void
cb_define (pfile, line, node) cb_define (cpp_reader *pfile, unsigned int line, cpp_hashnode *node)
cpp_reader *pfile;
unsigned int line;
cpp_hashnode *node;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fputs ("#define ", print.outf); fputs ("#define ", print.outf);
...@@ -334,10 +314,8 @@ cb_define (pfile, line, node) ...@@ -334,10 +314,8 @@ cb_define (pfile, line, node)
} }
static void static void
cb_undef (pfile, line, node) cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; cpp_hashnode *node)
unsigned int line;
cpp_hashnode *node;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fprintf (print.outf, "#undef %s\n", NODE_NAME (node)); fprintf (print.outf, "#undef %s\n", NODE_NAME (node));
...@@ -345,12 +323,8 @@ cb_undef (pfile, line, node) ...@@ -345,12 +323,8 @@ cb_undef (pfile, line, node)
} }
static void static void
cb_include (pfile, line, dir, header, angle_brackets) cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, unsigned int line,
cpp_reader *pfile ATTRIBUTE_UNUSED; const unsigned char *dir, const char *header, int angle_brackets)
unsigned int line;
const unsigned char *dir;
const char *header;
int angle_brackets;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
if (angle_brackets) if (angle_brackets)
...@@ -365,8 +339,7 @@ cb_include (pfile, line, dir, header, angle_brackets) ...@@ -365,8 +339,7 @@ cb_include (pfile, line, dir, header, angle_brackets)
pointing to freed memory, and so must not be dereferenced. */ pointing to freed memory, and so must not be dereferenced. */
void void
pp_file_change (map) pp_file_change (const struct line_map *map)
const struct line_map *map;
{ {
const char *flags = ""; const char *flags = "";
...@@ -398,9 +371,7 @@ pp_file_change (map) ...@@ -398,9 +371,7 @@ pp_file_change (map)
/* Copy a #pragma directive to the preprocessed output. */ /* Copy a #pragma directive to the preprocessed output. */
static void static void
cb_def_pragma (pfile, line) cb_def_pragma (cpp_reader *pfile, unsigned int line)
cpp_reader *pfile;
unsigned int line;
{ {
maybe_print_line (print.map, line); maybe_print_line (print.map, line);
fputs ("#pragma ", print.outf); fputs ("#pragma ", print.outf);
...@@ -410,10 +381,7 @@ cb_def_pragma (pfile, line) ...@@ -410,10 +381,7 @@ cb_def_pragma (pfile, line)
/* Dump out the hash table. */ /* Dump out the hash table. */
static int static int
dump_macro (pfile, node, v) dump_macro (cpp_reader *pfile, cpp_hashnode *node, void *v ATTRIBUTE_UNUSED)
cpp_reader *pfile;
cpp_hashnode *node;
void *v ATTRIBUTE_UNUSED;
{ {
if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN)) if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
{ {
......
/* Various declarations for the C and C++ pretty-printers. /* Various declarations for the C and C++ pretty-printers.
Copyright (C) 2002 Free Software Foundation, Inc. Copyright (C) 2002, 2003 Free Software Foundation, Inc.
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net> Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
This file is part of GCC. This file is part of GCC.
...@@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -32,7 +32,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
typedef struct c_pretty_print_info *c_pretty_printer; typedef struct c_pretty_print_info *c_pretty_printer;
/* The type of a C pretty-printer 'member' function. */ /* The type of a C pretty-printer 'member' function. */
typedef void (*c_pretty_print_fn) PARAMS ((c_pretty_printer, tree)); typedef void (*c_pretty_print_fn) (c_pretty_printer, tree);
struct c_pretty_print_info struct c_pretty_print_info
{ {
...@@ -144,22 +144,22 @@ struct c_pretty_print_info ...@@ -144,22 +144,22 @@ struct c_pretty_print_info
macro must be overridden by any subclass of c_pretty_print_info. */ macro must be overridden by any subclass of c_pretty_print_info. */
#define pp_c_base(PP) (PP) #define pp_c_base(PP) (PP)
extern void pp_c_pretty_printer_init PARAMS ((c_pretty_printer)); extern void pp_c_pretty_printer_init (c_pretty_printer);
/* Declarations. */ /* Declarations. */
void pp_c_attributes PARAMS ((c_pretty_printer, tree)); void pp_c_attributes (c_pretty_printer, tree);
void pp_c_cv_qualifier PARAMS ((c_pretty_printer, int)); void pp_c_cv_qualifier (c_pretty_printer, int);
void pp_c_parameter_declaration_clause PARAMS ((c_pretty_printer, tree)); void pp_c_parameter_declaration_clause (c_pretty_printer, tree);
void pp_c_declaration PARAMS ((c_pretty_printer, tree)); void pp_c_declaration (c_pretty_printer, tree);
/* Statements. */ /* Statements. */
void pp_c_statement PARAMS ((c_pretty_printer, tree)); void pp_c_statement (c_pretty_printer, tree);
/* Expressions. */ /* Expressions. */
void pp_c_expression PARAMS ((c_pretty_printer, tree)); void pp_c_expression (c_pretty_printer, tree);
void pp_c_logical_or_expression PARAMS ((c_pretty_printer, tree)); void pp_c_logical_or_expression (c_pretty_printer, tree);
void pp_c_expression_list PARAMS ((c_pretty_printer, tree)); void pp_c_expression_list (c_pretty_printer, tree);
void pp_c_cast_expression PARAMS ((c_pretty_printer, tree)); void pp_c_cast_expression (c_pretty_printer, tree);
void pp_c_postfix_expression PARAMS ((c_pretty_printer, tree)); void pp_c_postfix_expression (c_pretty_printer, tree);
void pp_c_initializer PARAMS ((c_pretty_printer, tree)); void pp_c_initializer (c_pretty_printer, tree);
void pp_c_literal PARAMS ((c_pretty_printer, tree)); void pp_c_literal (c_pretty_printer, tree);
#endif /* GCC_C_PRETTY_PRINTER */ #endif /* GCC_C_PRETTY_PRINTER */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment