diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-08 19:21:44 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-02-08 19:21:44 -0500 |
commit | 2628709d5a63f2aab529662edbfa0f6d07d7e056 (patch) | |
tree | d260159d08862ef437540130f006ba8dbe49a09e | |
parent | 442e881d89e931d7aa1f6794e6814d6eab08a26f (diff) | |
download | gcc-2628709d5a63f2aab529662edbfa0f6d07d7e056.zip gcc-2628709d5a63f2aab529662edbfa0f6d07d7e056.tar.gz gcc-2628709d5a63f2aab529662edbfa0f6d07d7e056.tar.bz2 |
Append "#include <stdlib.h>" to assert.h if it uses exit or abort.
From-SVN: r6507
-rwxr-xr-x | gcc/fixproto | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/gcc/fixproto b/gcc/fixproto index dd4234a..67241ea 100755 --- a/gcc/fixproto +++ b/gcc/fixproto @@ -4,7 +4,7 @@ # fixproto TARGET-DIR SOURCE-DIR-ALL SOURCE-DIR-STD # # COPYRIGHT -# Copyright (C) 1993 Free Software Foundation, Inc. +# Copyright (C) 1993, 1994 Free Software Foundation, Inc. # This file is part of GNU CC. # # GNU CC is free software; you can redistribute it and/or modify @@ -329,15 +329,27 @@ for code in ALL STD ; do rm -f fixtmp.c fixtmp.i done # check for broken assert.h that needs stdio.h - if test -f $abs_source_dir/assert.h -a \! -f $abs_target_dir/assert.h \ - && grep 'stderr' $abs_source_dir/assert.h >/dev/null - then - if grep 'include.*stdio.h' $abs_source_dir/assert.h >/dev/null - then true - else - echo 'Fixing broken assert.h (needs stdio.h)' - cat $abs_source_dir/assert.h >$abs_target_dir/assert.h - echo '#include <stdio.h>' >>$abs_target_dir/assert.h + if test -f $abs_source_dir/assert.h -a \! -f $abs_target_dir/assert.h; then + if grep 'stderr' $abs_source_dir/assert.h >/dev/null ; then + if grep 'include.*stdio.h' $abs_source_dir/assert.h >/dev/null ; then + true + else + echo 'Fixing broken assert.h (needs stdio.h)' + cat $abs_source_dir/assert.h >$abs_target_dir/assert.h + echo '#include <stdio.h>' >>$abs_target_dir/assert.h + fi + fi + if grep 'exit *(' $abs_source_dir/assert.h >/dev/null || + grep 'abort *(' $abs_source_dir/assert.h >/dev/null ; then + if grep 'include.*stdlib.h' $abs_source_dir/assert.h >/dev/null ; then + true + else + echo 'Fixing broken assert.h (needs stdlib.h)' + if test ! -f $abs_target_dir/assert.h ; then + cat $abs_source_dir/assert.h >$abs_target_dir/assert.h + fi + echo '#include <stdlib.h>' >>$abs_target_dir/assert.h + fi fi fi done_dirs="$done_dir $rel_source_dir" |