/* C Compatible Compiler Preprocessor (CCCP)
- Copyright (C) 1986, 87, 89, 92-99, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
+ 1998, 1999, 2000 Free Software Foundation, Inc.
Written by Paul Rubin, June 1986
Adapted to ANSI C, Richard Stallman, Jan 1987
#include "pcp.h"
#include "intl.h"
#include "prefix.h"
+#include "version.h"
#ifdef MULTIBYTE_CHARS
#include "mbchar.h"
# define STANDARD_INCLUDE_DIR "/usr/include"
#endif
-/* By default, colon separates directories in a path. */
-#ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR ':'
-#endif
-
-/* By default, a slash separates directory names. */
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-#endif
-
/* By default, the suffix for object files is ".o". */
#ifdef OBJECT_SUFFIX
# define HAVE_OBJECT_SUFFIX
/* External declarations. */
-extern char *version_string;
-HOST_WIDEST_INT parse_escape PROTO((char **, HOST_WIDEST_INT));
-HOST_WIDEST_INT parse_c_expression PROTO((char *, int));
+HOST_WIDEST_INT parse_escape PARAMS ((char **, HOST_WIDEST_INT));
+HOST_WIDEST_INT parse_c_expression PARAMS ((char *, int));
\f
/* Name under which this program was invoked. */
int c89;
-/* Nonzero for the 199x C Standard. */
+/* Nonzero for the 1999 C Standard. */
-int c9x;
+int c99;
/* Nonzero causes output not to be done,
but directives such as #define that have side effects
#define REST_EXTENSION_LENGTH (sizeof (rest_extension) - 1)
/* This is the implicit parameter name when using variable number of
- parameters for macros using the ISO C 9x extension. */
+ parameters for macros using the ISO C 99 extension. */
static char va_args_name[] = "__VA_ARGS__";
#define VA_ARGS_NAME_LENGTH (sizeof (va_args_name) - 1)
\f
/* `struct directive' defines one #-directive, including how to handle it. */
-#define DO_PROTO PROTO((U_CHAR *, U_CHAR *, FILE_BUF *, struct directive *))
+#define DO_PROTO PARAMS ((U_CHAR *, U_CHAR *, FILE_BUF *, struct directive *))
struct directive {
int length; /* Length of name */
so don't look for #include "foo" the source-file directory. */
static int ignore_srcdir;
\f
-static int safe_read PROTO((int, char *, int));
-static void safe_write PROTO((int, const char *, int));
+static int safe_read PARAMS ((int, char *, int));
+static void safe_write PARAMS ((int, const char *, int));
-int main PROTO((int, char **));
+int main PARAMS ((int, char **));
-static void path_include PROTO((char *));
+static void path_include PARAMS ((char *));
-static const U_CHAR *index0 PROTO((const U_CHAR *, int, size_t));
+static const U_CHAR *index0 PARAMS ((const U_CHAR *, int, size_t));
-static void trigraph_pcp PROTO((FILE_BUF *));
-static void check_white_space PROTO((FILE_BUF *));
+static void trigraph_pcp PARAMS ((FILE_BUF *));
+static void check_white_space PARAMS ((FILE_BUF *));
-static void newline_fix PROTO((U_CHAR *));
-static void name_newline_fix PROTO((U_CHAR *));
+static void newline_fix PARAMS ((U_CHAR *));
+static void name_newline_fix PARAMS ((U_CHAR *));
-static const char *get_lintcmd PROTO((const U_CHAR *, const U_CHAR *,
- const U_CHAR **, int *, int *));
+static const char *get_lintcmd PARAMS ((const U_CHAR *, const U_CHAR *,
+ const U_CHAR **, int *, int *));
-static void rescan PROTO((FILE_BUF *, int));
+static void rescan PARAMS ((FILE_BUF *, int));
-static FILE_BUF expand_to_temp_buffer PROTO((const U_CHAR *, const U_CHAR *,
- int, int));
+static FILE_BUF expand_to_temp_buffer PARAMS ((const U_CHAR *, const U_CHAR *,
+ int, int));
-static int handle_directive PROTO((FILE_BUF *, FILE_BUF *));
+static int handle_directive PARAMS ((FILE_BUF *, FILE_BUF *));
-static struct tm *timestamp PROTO((void));
-static void special_symbol PROTO((HASHNODE *, FILE_BUF *));
+static struct tm *timestamp PARAMS ((void));
+static void special_symbol PARAMS ((HASHNODE *, FILE_BUF *));
-static int is_system_include PROTO((const char *));
-static char *base_name PROTO((const char *));
-static int absolute_filename PROTO((const char *));
-static size_t simplify_filename PROTO((char *));
+static int is_system_include PARAMS ((const char *));
+static char *base_name PARAMS ((const char *));
+static int absolute_filename PARAMS ((const char *));
+static size_t simplify_filename PARAMS ((char *));
-static char *read_filename_string PROTO((int, FILE *));
-static struct file_name_map *read_name_map PROTO((const char *));
-static int open_include_file PROTO((char *, struct file_name_list *,
- const U_CHAR *, struct include_file **));
-static char *remap_include_file PROTO((char *, struct file_name_list *));
-static int lookup_ino_include PROTO((struct include_file *));
+static char *read_filename_string PARAMS ((int, FILE *));
+static struct file_name_map *read_name_map PARAMS ((const char *));
+static int open_include_file PARAMS ((char *, struct file_name_list *,
+ const U_CHAR *, struct include_file **));
+static char *remap_include_file PARAMS ((char *, struct file_name_list *));
+static int lookup_ino_include PARAMS ((struct include_file *));
-static void finclude PROTO((int, struct include_file *, FILE_BUF *, int, struct file_name_list *));
-static void record_control_macro PROTO((struct include_file *, const U_CHAR *));
+static void finclude PARAMS ((int, struct include_file *, FILE_BUF *, int,
+ struct file_name_list *));
+static void record_control_macro PARAMS ((struct include_file *,
+ const U_CHAR *));
-static char *check_precompiled PROTO((int, struct stat *, const char *,
- const char **));
-static int check_preconditions PROTO((const char *));
-static void pcfinclude PROTO((U_CHAR *, const U_CHAR *, FILE_BUF *));
-static void pcstring_used PROTO((HASHNODE *));
-static void write_output PROTO((void));
-static void pass_thru_directive PROTO((const U_CHAR *, const U_CHAR *,
- FILE_BUF *, struct directive *));
+static char *check_precompiled PARAMS ((int, struct stat *, const char *,
+ const char **));
+static int check_preconditions PARAMS ((const char *));
+static void pcfinclude PARAMS ((U_CHAR *, const U_CHAR *, FILE_BUF *));
+static void pcstring_used PARAMS ((HASHNODE *));
+static void write_output PARAMS ((void));
+static void pass_thru_directive PARAMS ((const U_CHAR *, const U_CHAR *,
+ FILE_BUF *, struct directive *));
-static MACRODEF create_definition PROTO((const U_CHAR *, const U_CHAR *,
- FILE_BUF *));
+static MACRODEF create_definition PARAMS ((const U_CHAR *, const U_CHAR *,
+ FILE_BUF *));
-static int check_macro_name PROTO((const U_CHAR *, int));
-static int compare_defs PROTO((DEFINITION *, DEFINITION *));
-static int comp_def_part PROTO((int, const U_CHAR *, int, const U_CHAR *,
- int, int));
+static int check_macro_name PARAMS ((const U_CHAR *, int));
+static int compare_defs PARAMS ((DEFINITION *, DEFINITION *));
+static int comp_def_part PARAMS ((int, const U_CHAR *, int, const U_CHAR *,
+ int, int));
-static DEFINITION *collect_expansion PROTO((const U_CHAR *, const U_CHAR *,
- int, struct arglist *));
+static DEFINITION *collect_expansion PARAMS ((const U_CHAR *, const U_CHAR *,
+ int, struct arglist *));
-int check_assertion PROTO((const U_CHAR *, int, int, struct arglist *));
-static int compare_token_lists PROTO((struct arglist *, struct arglist *));
+int check_assertion PARAMS ((const U_CHAR *, int, int, struct arglist *));
+static int compare_token_lists PARAMS ((struct arglist *, struct arglist *));
-static struct arglist *read_token_list PROTO((const U_CHAR **, const U_CHAR *,
- int *));
-static void free_token_list PROTO((struct arglist *));
+static struct arglist *read_token_list PARAMS ((const U_CHAR **,
+ const U_CHAR *, int *));
+static void free_token_list PARAMS ((struct arglist *));
-static ASSERTION_HASHNODE *assertion_install PROTO((const U_CHAR *, int, int));
-static ASSERTION_HASHNODE *assertion_lookup PROTO((const U_CHAR *, int, int));
-static void delete_assertion PROTO((ASSERTION_HASHNODE *));
+static ASSERTION_HASHNODE *assertion_install PARAMS ((const U_CHAR *, int, int));
+static ASSERTION_HASHNODE *assertion_lookup PARAMS ((const U_CHAR *, int, int));
+static void delete_assertion PARAMS ((ASSERTION_HASHNODE *));
-static void do_once PROTO((void));
+static void do_once PARAMS ((void));
-static HOST_WIDEST_INT eval_if_expression PROTO((const U_CHAR *, int));
-static void conditional_skip PROTO((FILE_BUF *, int, enum node_type,
- const U_CHAR *, FILE_BUF *));
-static void skip_if_group PROTO((FILE_BUF *, int, FILE_BUF *));
-static void validate_else PROTO((const U_CHAR *, const U_CHAR *));
+static HOST_WIDEST_INT eval_if_expression PARAMS ((const U_CHAR *, int));
+static void conditional_skip PARAMS ((FILE_BUF *, int, enum node_type,
+ const U_CHAR *, FILE_BUF *));
+static void skip_if_group PARAMS ((FILE_BUF *, int, FILE_BUF *));
+static void validate_else PARAMS ((const U_CHAR *, const U_CHAR *));
-static U_CHAR *skip_to_end_of_comment PROTO((FILE_BUF *, int *, int));
-static U_CHAR *skip_quoted_string PROTO((const U_CHAR *, const U_CHAR *,
- int, int *, int *, int *));
-static char *quote_string PROTO((char *, const char *, size_t));
-static U_CHAR *skip_paren_group PROTO((FILE_BUF *));
+static U_CHAR *skip_to_end_of_comment PARAMS ((FILE_BUF *, int *, int));
+static U_CHAR *skip_quoted_string PARAMS ((const U_CHAR *, const U_CHAR *,
+ int, int *, int *, int *));
+static char *quote_string PARAMS ((char *, const char *, size_t));
+static U_CHAR *skip_paren_group PARAMS ((FILE_BUF *));
/* Last arg to output_line_directive. */
enum file_change_code {same_file, enter_file, leave_file};
-static void output_line_directive PROTO((FILE_BUF *, FILE_BUF *, int, enum file_change_code));
+static void output_line_directive PARAMS ((FILE_BUF *, FILE_BUF *, int, enum file_change_code));
-static void macroexpand PROTO((HASHNODE *, FILE_BUF *));
+static void macroexpand PARAMS ((HASHNODE *, FILE_BUF *));
struct argdata;
-static int macarg PROTO((struct argdata *, int));
+static int macarg PARAMS ((struct argdata *, int));
-static U_CHAR *macarg1 PROTO((U_CHAR *, const U_CHAR *, struct hashnode *, int *, int *, int *, int));
+static U_CHAR *macarg1 PARAMS ((U_CHAR *, const U_CHAR *, struct hashnode *, int *, int *, int *, int));
-static int discard_comments PROTO((U_CHAR *, int, int));
+static int discard_comments PARAMS ((U_CHAR *, int, int));
-static void change_newlines PROTO((struct argdata *));
+static void change_newlines PARAMS ((struct argdata *));
-static void notice PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-static void vnotice PROTO((const char *, va_list));
-void error PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-void verror PROTO((const char *, va_list));
-static void error_from_errno PROTO((const char *));
-void warning PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-static void vwarning PROTO((const char *, va_list));
-static void error_with_line PVPROTO((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
-static void verror_with_line PROTO((int, const char *, va_list));
-static void vwarning_with_line PROTO((int, const char *, va_list));
-static void warning_with_line PVPROTO((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
-void pedwarn PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1;
-void pedwarn_with_line PVPROTO((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
-static void pedwarn_with_file_and_line PVPROTO((const char *, size_t, int, const char *, ...)) ATTRIBUTE_PRINTF_4;
-static void pedwarn_strange_white_space PROTO((int));
+static void notice PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+static void vnotice PARAMS ((const char *, va_list));
+void error PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+void verror PARAMS ((const char *, va_list));
+static void error_from_errno PARAMS ((const char *));
+void warning PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+static void vwarning PARAMS ((const char *, va_list));
+static void error_with_line PARAMS ((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
+static void verror_with_line PARAMS ((int, const char *, va_list));
+static void vwarning_with_line PARAMS ((int, const char *, va_list));
+static void warning_with_line PARAMS ((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
+void pedwarn PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1;
+void pedwarn_with_line PARAMS ((int, const char *, ...)) ATTRIBUTE_PRINTF_2;
+static void pedwarn_with_file_and_line PARAMS ((const char *, size_t, int, const char *, ...)) ATTRIBUTE_PRINTF_4;
+static void pedwarn_strange_white_space PARAMS ((int));
-static void print_containing_files PROTO((void));
+static void print_containing_files PARAMS ((void));
-static int line_for_error PROTO((int));
-static int grow_outbuf PROTO((FILE_BUF *, int));
+static int line_for_error PARAMS ((int));
+static int grow_outbuf PARAMS ((FILE_BUF *, int));
-static HASHNODE *install PROTO((const U_CHAR *, int, enum node_type,
- const char *, int));
-HASHNODE *lookup PROTO((const U_CHAR *, int, int));
-static void delete_macro PROTO((HASHNODE *));
-static int hashf PROTO((const U_CHAR *, int, int));
+static HASHNODE *install PARAMS ((const U_CHAR *, int, enum node_type,
+ const char *, int));
+HASHNODE *lookup PARAMS ((const U_CHAR *, int, int));
+static void delete_macro PARAMS ((HASHNODE *));
+static int hashf PARAMS ((const U_CHAR *, int, int));
-static void dump_single_macro PROTO((HASHNODE *, FILE *));
-static void dump_all_macros PROTO((void));
-static void dump_defn_1 PROTO((const U_CHAR *, int, int, FILE *));
-static void dump_arg_n PROTO((DEFINITION *, int, FILE *));
+static void dump_single_macro PARAMS ((HASHNODE *, FILE *));
+static void dump_all_macros PARAMS ((void));
+static void dump_defn_1 PARAMS ((const U_CHAR *, int, int, FILE *));
+static void dump_arg_n PARAMS ((DEFINITION *, int, FILE *));
-static void initialize_char_syntax PROTO((void));
-static void initialize_builtins PROTO((FILE_BUF *, FILE_BUF *));
+static void initialize_char_syntax PARAMS ((void));
+static void initialize_builtins PARAMS ((FILE_BUF *, FILE_BUF *));
-static void make_definition PROTO((char *));
-static void make_undef PROTO((char *, FILE_BUF *));
+static void make_definition PARAMS ((char *));
+static void make_undef PARAMS ((char *, FILE_BUF *));
-static void make_assertion PROTO((const char *, const char *));
+static void make_assertion PARAMS ((const char *, const char *));
-static struct file_name_list *new_include_prefix PROTO((struct file_name_list *, const char *, const char *, const char *));
-static void append_include_chain PROTO((struct file_name_list *, struct file_name_list *));
+static struct file_name_list *new_include_prefix PARAMS ((struct file_name_list *, const char *, const char *, const char *));
+static void append_include_chain PARAMS ((struct file_name_list *, struct file_name_list *));
-static int quote_string_for_make PROTO((char *, const char *));
-static void deps_output PROTO((const char *, int));
+static int quote_string_for_make PARAMS ((char *, const char *));
+static void deps_output PARAMS ((const char *, int));
-void fatal PVPROTO((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
-static void perror_with_name PROTO((const char *));
-static void pfatal_with_name PROTO((const char *)) ATTRIBUTE_NORETURN;
-static void pipe_closed PROTO((int)) ATTRIBUTE_NORETURN;
+void fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
+void fancy_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
+static void perror_with_name PARAMS ((const char *));
+static void pfatal_with_name PARAMS ((const char *)) ATTRIBUTE_NORETURN;
+static void pipe_closed PARAMS ((int)) ATTRIBUTE_NORETURN;
-static void memory_full PROTO((void)) ATTRIBUTE_NORETURN;
-static void print_help PROTO((void));
+static void memory_full PARAMS ((void)) ATTRIBUTE_NORETURN;
+static void print_help PARAMS ((void));
\f
/* Read LEN bytes at PTR from descriptor DESC, for file FILENAME,
retrying if necessary. If MAX_READ_LEN is defined, read at most
printf (" -lang-objc Assume that the input sources are in ObjectiveC\n");
printf (" -lang-objc++ Assume that the input sources are in ObjectiveC++\n");
printf (" -lang-asm Assume that the input sources are in assembler\n");
+ printf (" -lang-fortran Assume that the input sources are in Fortran\n");
printf (" -lang-chill Assume that the input sources are in Chill\n");
printf (" -std=<std name> Specify the conformance standard; one of:\n");
- printf (" gnu89, gnu9x, c89, c9x, iso9899:1990,\n");
- printf (" iso9899:199409, iso9899:199x\n");
+ printf (" gnu89, gnu99, c89, c99, iso9899:1990,\n");
+ printf (" iso9899:199409, iso9899:1999\n");
printf (" -+ Allow parsing of C++ style features\n");
printf (" -w Inhibit warning messages\n");
printf (" -Wtrigraphs Warn if trigraphs are encountered\n");
case 'l':
if (! strcmp (argv[i], "-lang-c"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 1, objc = 0;
else if (! strcmp (argv[i], "-lang-c89"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
}
else if (! strcmp (argv[i], "-lang-c++"))
- cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 0;
+ cplusplus = 1, cplusplus_comments = 1, c89 = 0, c99 = 0, objc = 0;
else if (! strcmp (argv[i], "-lang-objc"))
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 1;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 0, objc = 1;
else if (! strcmp (argv[i], "-lang-objc++"))
- cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 1;
+ cplusplus = 1, cplusplus_comments = 1, c89 = 0, c99 = 0, objc = 1;
else if (! strcmp (argv[i], "-lang-asm"))
lang_asm = 1;
+ else if (! strcmp (argv[i], "-lang-fortran"))
+ /* Doesn't actually do anything. */ ;
else if (! strcmp (argv[i], "-lint"))
for_lint = 1;
break;
case 's':
if (!strcmp (argv[i], "-std=gnu89"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
}
else if (!strcmp (argv[i], "-std=gnu9x")
|| !strcmp (argv[i], "-std=gnu99"))
{
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 1, objc = 0;
pend_defs[2*i+1] = "__STDC_VERSION__=199901L";
}
else if (!strcmp (argv[i], "-std=iso9899:1990")
|| !strcmp (argv[i], "-std=c89"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
}
else if (!strcmp (argv[i], "-std=iso9899:199409"))
{
- cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+ cplusplus = 0, cplusplus_comments = 0, c89 = 1, c99 = 0, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
pend_defs[2*i+1] = "__STDC_VERSION__=199409L";
|| !strcmp (argv[i], "-std=c9x")
|| !strcmp (argv[i], "-std=c99"))
{
- cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+ cplusplus = 0, cplusplus_comments = 1, c89 = 0, c99 = 1, objc = 0;
no_trigraphs = 0;
pend_defs[2*i] = "__STRICT_ANSI__";
pend_defs[2*i+1] = "__STDC_VERSION__=199901L";
struct file_name_list *dirtmp;
char *dir = argv[i][2] ? argv[i] + 2 : argv[++i];
- if (! ignore_srcdir && !strcmp (dir, "-")) {
+ if (! ignore_srcdir && dir && !strcmp (dir, "-")) {
ignore_srcdir = 1;
/* Don't use any preceding -I directories for #include <...>. */
first_bracket_include = 0;
fp->nominal_fname_len = strlen (in_fname);
fp->lineno = 0;
- /* In C++, wchar_t is a distinct basic type, and we can expect
- __wchar_t to be defined by cc1plus. */
- if (cplusplus)
- wchar_type = "__wchar_t";
-
/* Install __LINE__, etc. Must follow initialize_char_syntax
and option processing. */
initialize_builtins (fp, &outbuf);
case '\'':
case '\"':
{
- int backslash_newlines_p;
+ int backslash_newlines_p = 0;
register const U_CHAR *bp1
= skip_quoted_string (xp - 1, bp, ip->lineno,
break;
#endif
+#ifndef NO_BUILTIN_WCHAR_TYPE
case T_WCHAR_TYPE:
buf = wchar_type;
break;
+#endif
case T_USER_LABEL_PREFIX_TYPE:
buf = user_label_prefix;
/* Returns whether or not a given character is a directory separator.
Used by simplify_filename. */
-static inline int is_dir_separator PROTO ((int));
+static inline int is_dir_separator PARAMS ((int));
static inline
int
if (!is_idstart[*bp])
{
- if (c9x && limit - bp > (long) REST_EXTENSION_LENGTH
+ if (c99 && limit - bp > (long) REST_EXTENSION_LENGTH
&& bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0)
{
- /* This is the ISO C 9x way to write macros with variable
+ /* This is the ISO C 99 way to write macros with variable
number of arguments. */
rest_args = 1;
temp->rest_args = 1;
}
if (bp == temp->name && rest_args == 1)
{
- /* This is the ISO C 9x style. */
+ /* This is the ISO C 99 style. */
temp->name = (U_CHAR *) va_args_name;
temp->length = VA_ARGS_NAME_LENGTH;
}
SKIP_WHITE_SPACE (bp);
/* A comma at this point can only be followed by an identifier. */
if (!is_idstart[*bp]
- && !(c9x && limit - bp > (long) REST_EXTENSION_LENGTH
+ && !(c99 && limit - bp > (long) REST_EXTENSION_LENGTH
&& bcmp (rest_extension, bp, REST_EXTENSION_LENGTH) == 0)) {
error ("badly punctuated parameter list in `#define'");
goto nope;
do_once ();
}
- if (!strncmp (buf, "poison", 6)) {
+ if (!strncmp ((char *) buf, "poison", 6)) {
/* Poison these symbols so that all subsequent usage produces an
error message. */
U_CHAR *p = buf + 6;
int stringified_length_bound;
U_CHAR *free1, *free2;
U_CHAR *free_ptr;
- char newlines;
+ int newlines;
char use_count;
};
/* notice - output message to stderr */
static void
-notice VPROTO ((const char * msgid, ...))
+notice VPARAMS ((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char * msgid;
/* error - print error message and increment count of errors. */
void
-error VPROTO ((const char * msgid, ...))
+error VPARAMS ((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char * msgid;
/* Print error message but don't count it. */
void
-warning VPROTO ((const char * msgid, ...))
+warning VPARAMS ((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char * msgid;
}
static void
-error_with_line VPROTO ((int line, const char * msgid, ...))
+error_with_line VPARAMS ((int line, const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
int line;
}
static void
-warning_with_line VPROTO ((int line, const char * msgid, ...))
+warning_with_line VPARAMS ((int line, const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
int line;
/* Print an error message and maybe count it. */
void
-pedwarn VPROTO ((const char * msgid, ...))
+pedwarn VPARAMS ((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char * msgid;
}
void
-pedwarn_with_line VPROTO ((int line, const char * msgid, ...))
+pedwarn_with_line VPARAMS ((int line, const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
int line;
giving specified file name and line number, not current. */
static void
-pedwarn_with_file_and_line VPROTO ((const char *file, size_t file_len, int line,
- const char * msgid, ...))
+pedwarn_with_file_and_line VPARAMS ((const char *file, size_t file_len,
+ int line, const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char *file;
* refer to them.
*/
for (i = 'a'; i <= 'z'; i++) {
- is_idchar[TOUPPER(i)] = 1;
- is_idchar[i] = 1;
- is_idstart[TOUPPER(i)] = 1;
- is_idstart[i] = 1;
+ /* SKIP EBCIDIC holes, char must be a valid low case char */
+ if (ISLOWER(i)) {
+ is_idchar[TOUPPER(i)] = 1;
+ is_idchar[i] = 1;
+ is_idstart[TOUPPER(i)] = 1;
+ is_idstart[i] = 1;
+ }
}
for (i = '0'; i <= '9'; i++)
is_idchar[i] = 1;
#ifndef NO_BUILTIN_PTRDIFF_TYPE
install ((const U_CHAR *) "__PTRDIFF_TYPE__ ", -1, T_PTRDIFF_TYPE, NULL_PTR, -1);
#endif
+#ifndef NO_BUILTIN_WCHAR_TYPE
install ((const U_CHAR *) "__WCHAR_TYPE__", -1, T_WCHAR_TYPE, NULL_PTR, -1);
+#endif
install ((const U_CHAR *) "__USER_LABEL_PREFIX__", -1, T_USER_LABEL_PREFIX_TYPE,
NULL_PTR, -1);
install ((const U_CHAR *) "__REGISTER_PREFIX__", -1, T_REGISTER_PREFIX_TYPE,
outp, dp);
#endif
+#ifndef NO_BUILTIN_WCHAR_TYPE
sprintf (directive, " __WCHAR_TYPE__ %s\n", wchar_type);
output_line_directive (inp, outp, 0, same_file);
pass_thru_directive (udirective, &udirective[strlen (directive)],
outp, dp);
+#endif
sprintf (directive, " __DATE__ \"%s %2d %4d\"\n",
monthnames[timebuf->tm_mon],
}
\f
void
-fatal VPROTO ((const char * msgid, ...))
+fatal VPARAMS ((const char * msgid, ...))
{
#ifndef ANSI_PROTOTYPES
const char * msgid;