diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-04-12 06:34:50 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 1995-04-12 06:34:50 +0000 |
commit | 1a44422d9cf808005f10103d9c008f616cbb7c5a (patch) | |
tree | a88c3383b51ecd5447d29ad34eaad02b05e634ed /gcc/fix-header.c | |
parent | 11741c89f16a3c816a3ad34783a603aee87d8756 (diff) | |
download | gcc-1a44422d9cf808005f10103d9c008f616cbb7c5a.tar.gz |
* fix-header.c (main): Fix loop over required_functions_list
(fatal): Also print inc_filename.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9364 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fix-header.c')
-rw-r--r-- | gcc/fix-header.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 4056605b8b7..7491f9c90c4 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -936,7 +936,7 @@ main (argc, argv) struct stat sbuf; int c; int i, done; - const char *cptr0, *cptr, **pptr; + const char *cptr, **pptr; int ifndef_line; int endif_line; long to_read; @@ -996,25 +996,16 @@ main (argc, argv) required_functions_list = include_entry->required; /* Count and mark the prototypes required for this include file. */ - for (cptr = required_functions_list, cptr0 = cptr, done = 0; - !done; cptr++) + for (cptr = required_functions_list; *cptr!= '\0'; ) { - if (*cptr == '\0') - { - if (cptr[1] == 0) - break; - else - { - struct fn_decl *fn = lookup_std_proto (cptr0, strlen (cptr0)); - required_unseen_count++; - if (fn == NULL) - fprintf (stderr, "Internal error: No prototype for %s\n", - cptr0); - else - SET_REQUIRED (fn); - } - cptr0 = cptr + 1; - } + int name_len = strlen (cptr); + struct fn_decl *fn = lookup_std_proto (cptr, name_len); + required_unseen_count++; + if (fn == NULL) + fprintf (stderr, "Internal error: No prototype for %s\n", cptr); + else + SET_REQUIRED (fn); + cptr += name_len + 1; } read_scan_file (argv[2], argc - 4, argv + 4); @@ -1197,7 +1188,7 @@ void fatal (str, arg) char *str, *arg; { - fprintf (stderr, "%s: ", progname); + fprintf (stderr, "%s: %s: ", progname, inc_filename); fprintf (stderr, str, arg); fprintf (stderr, "\n"); exit (FAILURE_EXIT_CODE); |