aboutsummaryrefslogtreecommitdiff
path: root/gcc/protoize.c
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-11-24 00:11:19 +0000
committerRichard Stallman <rms@gnu.org>1993-11-24 00:11:19 +0000
commit0ef8d7621cf691560ed83b3eabf8a7dd89dd5bc6 (patch)
tree9808cc038efc6e5b029dd53a32f9db72218b1def /gcc/protoize.c
parent9db931afe6a4dd7329b958ef45116cb4f22f6a80 (diff)
downloadgcc-0ef8d7621cf691560ed83b3eabf8a7dd89dd5bc6.zip
gcc-0ef8d7621cf691560ed83b3eabf8a7dd89dd5bc6.tar.gz
gcc-0ef8d7621cf691560ed83b3eabf8a7dd89dd5bc6.tar.bz2
(save_def_or_dec): If function's aux info doesn't end with a closeparen, ignore it.
(save_def_or_dec): If function's aux info doesn't end with a closeparen, ignore it. (xmalloc, xrealloc): Cast result of malloc. From-SVN: r6152
Diffstat (limited to 'gcc/protoize.c')
-rw-r--r--gcc/protoize.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/protoize.c b/gcc/protoize.c
index dc3c2ff..5cff35d 100644
--- a/gcc/protoize.c
+++ b/gcc/protoize.c
@@ -611,7 +611,7 @@ xmalloc (byte_count)
{
pointer_type rv;
- rv = malloc (byte_count);
+ rv = (pointer_type) malloc (byte_count);
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
@@ -631,7 +631,7 @@ xrealloc (old_space, byte_count)
{
pointer_type rv;
- rv = realloc (old_space, byte_count);
+ rv = (pointer_type) realloc (old_space, byte_count);
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
@@ -1710,11 +1710,18 @@ save_def_or_dec (l, is_syscalls)
def_dec_p->ansi_decl
= dupnstr (ansi_start, (size_t) ((semicolon_p+1) - ansi_start));
- }
- /* Backup and point at the final right paren of the final argument list. */
+ /* Backup and point at the final right paren of the final argument list. */
+
+ p--;
- p--;
+ while (p != ansi_start && (p[-1] == ' ' || p[-1] == '\t')) p--;
+ if (p[-1] != ')')
+ {
+ free_def_dec (def_dec_p);
+ return;
+ }
+ }
/* Now isolate a whole set of formal argument lists, one-by-one. Normally,
there will only be one list to isolate, but there could be more. */