aboutsummaryrefslogtreecommitdiff
path: root/gcc/cccp.c
AgeCommit message (Collapse)AuthorFilesLines
1997-09-01cccp.c (sys_errlist): Remove special 4.4bsd declaration.Jeffrey A Law1-4/+0
* cccp.c (sys_errlist): Remove special 4.4bsd declaration. * collect2.c (sys_errlist): Likewise. * cpplib.c (sys_errlist): Likewise. * gcc.c (sys_errlist): Likewise. * protoize (sys_errlist): Likewise. * configure.in: Check for strerror. * xm-freebsd.h (HAVE_STRERROR): Remove definition. * xm-gnu.h (HAVE_STRERROR): Likewise. * xm-linux.h (HAVE_STRERROR): Likewise. * xm-netbsd.h (HAVE_STRERROR): Likewise. * xm-bsd386.h (HAVE_STRERROR): Likewise. * xm-cygwin32.h (HAVE_STRERROR): Likewise. * xm-dos.h (HAVE_STRERROR): Likewise. * xm-mingw32.h (HAVE_STRERROR): Likewise. * xm-pa.h (HAVE_STRERROR): Likewise. * xm-papro.h (HAVE_STRERROR): Likewise. * xm-sysv4.h (HAVE_STRERROR): Likewise. * configure, config.in: Rebuilt. Remove the need to define HAVE_STRERROR for each host port. From-SVN: r15011
1997-07-10(INO_T_EQ): Return 0 for MSDOS.Doug Evans1-2/+2
From-SVN: r14408
1997-06-27(INO_T_EQ): Define for Win32 but not Cygwin32.Richard Kenner1-0/+5
From-SVN: r14339
1997-05-18(VMS_write, VMS_read): Delete.Richard Kenner1-62/+21
(safe_write): If MAX_WRITE_LEN is defined, limit incremental write attempts to that amount. (safe_read): Analogous situation for MAX_READ_LEN. From-SVN: r14092
1997-05-06reformat a little to match GNU coding standards.Mike Stump1-15/+14
From-SVN: r14023
1997-04-13(do_include): Diagnose #import and #include_next if pedantic and if not in a ↵Richard Kenner1-1/+11
system header. (do_include): Diagnose #import and #include_next if pedantic and if not in a system header. (do_warning): #warning now causes an error if -pedantic-errors is given; this is needed since #warning isn't ANSI. From-SVN: r13887
1997-04-13(warn_undef): New variable.Richard Kenner1-0/+8
(main): Set warn_undef from -Wundef and -Wno-undef. From-SVN: r13876
1997-03-19(do_error, do_warning): Fix memory leak.Richard Kenner1-2/+2
From-SVN: r13752
1997-03-19(output_line_directive): Do not output negative line numbers whenRichard Kenner1-3/+3
analyzing directives like `#line 0'. From-SVN: r13751
1997-03-19(c89): New decl.Richard Kenner1-9/+14
(main): Set it to 1 if -lang-c89. From-SVN: r13747
1997-03-17[#if VMS] (O_RDONLY, O_WRONLY): Delete (redundant).Richard Kenner1-10/+10
(BSTRING): Delete (obsolete; usage occurs prior to definition). (do_include): Handle old VAX C style includes better. From-SVN: r13721
1997-02-16(special_symbol): Don't treat "L" in "L'...'" as identifier.Richard Kenner1-4/+12
(check_macro_name, collect_expansion, rescan): Likewise. From-SVN: r13659
1997-02-16(is_space): Now external.Richard Kenner1-2/+2
(is_hor_space): Now static. From-SVN: r13653
1997-02-02(rescan): Insert a space after `.' as well, to prevent accidental ↵Richard Kenner1-3/+3
token-pasting (e.g. (rescan): Insert a space after `.' as well, to prevent accidental token-pasting (e.g. `.x' -> `.10'). From-SVN: r13578
1997-01-19#define __attribute__ to be null if compiling with GCC older than 2.7,Richard Kenner1-1/+1
not 2.6. From-SVN: r13522
1997-01-04(PRINTF_PROTO): Use __printf__ in __attribute__, not printf.Richard Kenner1-3/+3
From-SVN: r13362
1996-12-07(LOCAL_INCLUDE_DIR): Remove default definition.Richard Kenner1-4/+6
(include_defaults_array): Do not use LOCAL_INCLUDE_DIR or TOOL_INCLUDE_DIR if they are not defined. From-SVN: r13238
1996-10-09(do_include): Treat ENOTDIR like ENOENT when an open fails.Richard Kenner1-1/+1
From-SVN: r12939
1996-10-09(dollars_in_ident): Remove; replaced by is_idchar['$'].Richard Kenner1-24/+7
(main): Initialize is_idchar and is_idstart directly when given -$. Ignore DOLLARS_IN_IDENTIFIERS. (rescan): Diagnose $ in identifier if pedantic. (initialize_char_syntax): Assume $ is allowed in identifier; `main' will change this if -$ is given. From-SVN: r12934
1996-09-24(struct directive, directive_table, handle_directive): pass_thru now 1 for ↵Richard Kenner1-14/+19
#define and 2 for #pragma. (struct directive, directive_table, handle_directive): pass_thru now 1 for #define and 2 for #pragma. (handle_directive): When deciding whether to suppress comment at end of directive, ignore tabs and spaces after comment. Remove redundant limit test. With -dD -C, copy comment when isolating definition. (skip_to_end_of_comment): With -C, don't copy newline at end of C++ comment. From-SVN: r12831
1996-08-18cccp.c (absolute_filename): Drive specifiers make the pathname absolute in ↵Doug Evans1-1/+5
cygwin32. * cccp.c (absolute_filename): Drive specifiers make the pathname absolute in cygwin32. From-SVN: r12655
1996-07-03formatting tweaksMike Stump1-202/+183
From-SVN: r12390
1996-06-24(create_definition): Diagnose `#define #' only once.Paul Eggert1-1/+1
From-SVN: r12327
1996-05-05(include_defaults_array): For C++, also searchRichard Kenner1-0/+1
OLD_GPLUSPLUS_INCLUDE_DIR. From-SVN: r11930
1996-02-21(validate_else): Don't loop given `#endif /'.Paul Eggert1-24/+30
Handle multiple adjacent backslash-newlines correctly. Accept a new parameter LIMIT to specify end of input; this prevents confusion when the input contains '\0' characters. (collect_expansion): Fix off-by-1 error when searching for `*/' at end of a comment used for traditional token concatenation. (macarg1): Fix off-by-1 error when skipping past `*/' at end of comment. From-SVN: r11330
1996-01-27(initialize_builtins): Add def of __HAVE_BUILTIN_SETJMP__.Richard Kenner1-0/+1
From-SVN: r11114
1996-01-18(PTR_INT_TYPE): Remove obsolete define to `long'.Paul Eggert1-19/+13
(parse_escape, parse_c_expression, eval_if_expression, get_lintcmd, do_line, do_if, do_elif): Replace `long' with `HOST_WIDE_INT'. (trigraph_pcp): Don't assume a pointer difference fits in an int. From-SVN: r11060
1996-01-17(HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Put back.Richard Kenner1-3/+17
(pcfinclude): Use HOST_WIDE_INT for casting pointer to integer. From-SVN: r11037
1996-01-16(new_include_prefix): Ignore ENOTDIR error from stat.Jim Wilson1-1/+1
From-SVN: r11032
1996-01-16(HOST_BITS_PER_WIDE_INT, HOST_WIDE_INT): Remove.Richard Kenner1-25/+11
(parse_escape, parse_c_expression, eval_if_expression): Change return type to `long'; all callers changed. (pcfinclude): Use `int', not HOST_WIDE_INT; any integral type will do. From-SVN: r11025
1996-01-16(skip_quoted_string): If pedantic and not pedantic_errors,Richard Kenner1-7/+11
skipped multiline strings elicit a warning, not an error. (rescan): Minor code reorg to keep it parallel with skip_quoted_string. From-SVN: r11023
1996-01-15(do_xifdef): Warn about `#ifdef 0' if not traditional; formerly theRichard Kenner1-5/+7
warning was issued if not pedantic. From-SVN: r10992
1995-12-29(eval_if_expression): End expression with '\n', not '\0' so '\0' canRichard Kenner1-0/+1
be diagnosed properly. From-SVN: r10903
1995-12-28(do_include): In VMS, worry only about EACCES when open fails.Richard Kenner1-0/+11
(new_include_prefix): Don't try to stat dir prefixes in VMS. From-SVN: r10890
1995-12-17Try harder not to open or stat the same include file twice.Richard Kenner1-824/+706
Simplify include file names so that they are more likely to match. E.g. simplify "./a//b" to "a/b". Represent directories with simplified prefixes, e.g. replace "./a//b" with "a/b/", and "." with "". (absolute_filename): New function. (do_include): Use it. (read_name_map): Likewise; this makes things more consistent for DOS. (main, do_include, open_include_file): -M output now contains operands of -imacros and -include. (skip_to_end_of_comment): When copying a // comment, don't try to change it to a /* comment. (rescan, skip_if_group, skip_to_end_of_comment, macarg1): Tune. (rescan, skip_if_group, skip_to_end_of_comment, macarg1): If warn_comments is nonzero, warn if backslash-newline appears in a // comment. Simplify method for finding /* /* */ comment. (skip_if_group): Optionally warn if /* /* */ appears between # and a directive inside a skipped if group. (macarg): Optionally warn if /* /* */ appears in a macro argument. (strncat, VMS_strncat, vms_ino_t, ino_t): Remove. (INCLUDE_LEN_FUDGE): Add 2 if VMS, for trailing ".h". (INO_T_EQ, INO_T_HASH): New macros. (struct file_buf): New member `inc'. (expand_to_temp_buffer): Initialize it. (struct file_name_list): New member `inc'. (struct file_name_list): New member `st'. c_system_include_path is now 1 if not 0. fname is now an array, not a pointer. (struct include_file): New members `next_ino', `deps_output', `st'. Remove members `inode' and `dev'; they are now in `st'. (INCLUDE_HASHSIZE): Rename from INCLUDE_HASH_SIZE. (include_hashtab): Rename from include_hash_table. (include_ino_hashtab): New variable. (main): Store file status in struct stat, not in long and int pieces. Use base_name to strip prefixes from file names. When printing directory prefixes, omit trailing / and print "" as ".". Fatal error if the input file is a directory. (main, path_include): Regularize operands of -include, -imacros, -isystem, -iwithprefix, and -iwithprefixbefore. Regularize default include directories. (do_include): Allocate dsp with alloca, since fname is now dynamically allocated. Use -3 to represent a never-opened file descriptor. Make copy of file name, and simplify the copy. Use base_name to identify the end of fname's directory. Do not prepend dir for "..." if it matches the search list's first dir. open_include_file now subsumes redundant_include_p and lookup_import. Use bypass_slot to remember when to skip directories when including a file that has already been seen. Instead of using 0 to represent the working directory, and "" to represent a directory to be ignored, use "" for the former, and assume the latter has been removed before we get here. Assume the directory prefixes have already been simplified. Report as errors all open failures other than ENOENT. Fatal error if fstat fails. Use new deps_output member to avoid printing dependencies twice. (bypass_hashtab): New variable. (do_include, open_control_file, record_control_macro): New convention: control_macro is "" if the file was imported or had #pragma once. (pragma_once_marker): Remove. (redundant_include_p, include_hash, lookup_include, lookup_import, add_import, file_size_and_mode): Remove; subsumed by open_include_file. (skip_redundant_dir_prefix): Remove; subsumed by simplify_filename. (is_system_include, read_name_map, remap_include_file): Assume arg is a directory prefix. (base_name, simplify_filename, remap_include_file, lookup_ino_include, new_include_prefix): New functions. (open_include_file): New arguments `importing' and `pinc'. Move filename mapping into new remap_include_file function. First try to find file by name in include_hashtab; if that doesn't work, open and fstat it and try to find it by inode and dev in include_ino_hashtab. (finclude): Get file status from inc->st instead of invoking fstat. Store inc into fp->inc so that record_control_macro doesn't need to do a table lookup. (finclude, record_control_macro): Accept struct include_file * instead of char * to identify include file. All callers changed. (check_precompiled): Get file status from new argument `st'. (do_pragma): Output at most one warning about #pragma implementation. Always return 0 instead of returning garbage sometimes. (do_pragma, hack_vms_include_specification): Use base_name for consistency, and remove redundant code. From Per Bothner: Unify the 3 separate mechanisms for avoiding processing of redundant include files: #import, #pragma once, and redundant_include_p to use a single more efficient data structure. (struct file_name_list): Remove no-longer needed field control_macro. (dont_repeat_files, all_include_files): Remove, no longer used. (struct import_file): Renmed to struct include_file, moved earlier in file, renamed field name to fname, and added control_macro field. (pragma_once_marker): New constant. (import_hash_table): Renamed to include_hash_table. (import_hash): Renamed to include_hash. (IMPORT_HASH_SIZE): Renamed to INCLUDE_HASH_SIZE. (main, path_include): Don't clear removed control_macro field. (lookup_include): New function - look up fname in include_hash_table. (redundant_include_p): Re-write to use lookup_include. (lookup_import, record_control_macro): Likewise. (add_import): Defer fstat to caller. Combine two xmallocs into one. (do_once): Use pragma_once_marker in include_hash_table. (do_pragma): Re-implement to scan include_hash_table. (do_include): Use new lookup_include and add_import. From-SVN: r10784
1995-11-29* cccp.c (do_include): Recognize c:\foo as absolute path name in DOS.Doug Evans1-0/+8
From-SVN: r10631
1995-10-26(handle_directive): Don't treat newline as white space when coalescingRichard Kenner1-4/+4
white space around a backslash-newline. From-SVN: r10519
1995-09-28(rescan): Expand `#if foo && #bar' without a bogus complaint about ↵Richard Kenner1-0/+3
preprocessor directives within macro args. (rescan): Expand `#if foo && #bar' without a bogus complaint about preprocessor directives within macro args. Expand `foo' in `foo#bar' without requiring a space before `#'. From-SVN: r10412
1995-09-12(is_system_include): Call skip_redundant_dir_prefix.Richard Kenner1-1/+1
From-SVN: r10348
1995-08-15(warning_with_line): Fix typo in declaration when !HAVE_VPRINTF andRichard Kenner1-1/+1
defined (__STDC__). From-SVN: r10245
1995-08-13(warning_with_line): New function.Richard Kenner1-2/+19
(trigraph_pcp): Use it, to avoid reporting line number. (vwarning_with_line): Don't report line number if zero. From-SVN: r10217
1995-07-26(do_include, read_name_map): Omit leading "./" and trailing "/" when it ↵Richard Kenner1-13/+34
makes sense. (do_include, read_name_map): Omit leading "./" and trailing "/" when it makes sense. (skip_redundant_dir_prefix): New function. From-SVN: r10163
1995-07-18(do_include): Prefix -H output lines with spaces, not dots.Richard Kenner1-17/+2
(output_dots): Remove. From-SVN: r10150
1995-07-18(main): cplusplus_comments now defaults to 1.Richard Kenner1-3/+4
But clear it if -traditional or the new option -lang-c89 is given. From-SVN: r10148
1995-07-10(rescan): Don't address outside of array when preprocessing C++Richard Kenner1-28/+19
comments. From-SVN: r10118
1995-06-19(collect_expansion): Work around enum bug in vax ultrix 4.3 pcc.Richard Kenner1-2/+2
From-SVN: r10012
1995-06-15Update FSF address.Richard Kenner1-1/+2
From-SVN: r9959
1995-05-16Use FATAL_EXIT_CODE instead of FAILURE_EXIT_CODE.Richard Kenner1-13/+5
From-SVN: r9725
1995-05-16Fix typos in comments.Richard Kenner1-2/+2
From-SVN: r9711
1995-05-12(enum node_type): Add T_IMMEDIATE_PREFIX_TYPE.Ken Raeburn1-0/+13
(special_symbol): Handle it; emit value of IMMEDIATE_PREFIX. (IMMEDIATE_PREFIX): Default to empty string. (initialize_builtins): Install __IMMEDIATE_PREFIX__ builtin, parallel to __REGISTER_PREFIX__. From-SVN: r9661