diff options
author | Per Bothner <bothner@gcc.gnu.org> | 1995-04-11 23:34:50 -0700 |
---|---|---|
committer | Per Bothner <bothner@gcc.gnu.org> | 1995-04-11 23:34:50 -0700 |
commit | ebc27362b382f9f23668927f632da14055164131 (patch) | |
tree | a88c3383b51ecd5447d29ad34eaad02b05e634ed /gcc/fix-header.c | |
parent | df87c8b70be341ad48c51e6460686d5eaf728ad8 (diff) | |
download | gcc-ebc27362b382f9f23668927f632da14055164131.zip gcc-ebc27362b382f9f23668927f632da14055164131.tar.gz gcc-ebc27362b382f9f23668927f632da14055164131.tar.bz2 |
fix-header.c (main): Fix loop over required_functions_list
* fix-header.c (main): Fix loop over required_functions_list
(fatal): Also print inc_filename.
From-SVN: r9364
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 4056605..7491f9c 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); |