PATCH for a rather bad cpplib related bug
Dave Brolley
brolley@cygnus.com
Mon Jul 5 08:44:00 GMT 1999
I don't think finish_parse is a good place for this check. There is alot that gets done after finish_parse is called from compile_file in toplev.c. Also, each
language has it's own finish_parse, so you would need to fix each language that uses cpplib (C, C++, OBJC). Perhaps this should be checked at the end of 'main'
along with the other checks of this nature.
Dave
Manfred Hollstein wrote:
> This is a fix for a rather bad bug in all recent egcs versions
> (including the release branch for gcc-2.95!!!) which have been
> configured to use the CPPLIB C preprocessor, i.e. `--enable-c-cpplib'.
>
> Suppose the following:
>
> $ cat << - > t.c
> #include <ThisFileDoesNotExist.h>
>
> main () {}
> $ gcc -c t.c
> t.c:1: ThisFileDoesNotExist.h: No such file or directory
> $
>
> BUT, it terminates with an exit status 0!!!!! This renders nearly all
> configure scripts useless, as they depend on a proper exit status of
> the invoked compiler. In fact, I recognized this while building
> xemacs-20.4 on i686-redhat6.0-linux-gnu with a gcc-2.95 configured
> with the `--enable-c-cpplib' option while it was looking for a
> non-existing db/db.h, deciding it was there....
>
> I know, the release branch is frozen right now, but I think, this is
> actually a serious bug worth to be fixed for the upcoming release.
>
> What do you think? OK to install?
>
> Cheers,
> manfred
>
> 1999-07-03 Manfred Hollstein <mhollstein@cygnus.com>
>
> * c-lex.c (finish_parse): If preprocessing has failed, exit with
> a failure.
>
> diff -rup -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el egcs-19990703.orig/gcc/c-lex.c egcs-19990703/gcc/c-lex.c
> --- egcs-19990703.orig/gcc/c-lex.c Fri Jul 2 20:42:54 1999
> +++ egcs-19990703/gcc/c-lex.c Sat Jul 3 12:55:02 1999
> @@ -258,6 +258,8 @@ finish_parse ()
> {
> #if USE_CPPLIB
> cpp_finish (&parse_in);
> + if (parse_in.errors)
> + exit (FATAL_EXIT_CODE);
> #else
> fclose (finput);
> #endif
More information about the Gcc-patches
mailing list