integrated cpplib and nonexistant input

Jakub Jelinek jakub@redhat.com
Sat Nov 4 12:40:00 GMT 2000


Hi!

With integrated cpplib when somebody mistakenly starts cc1 or cc1plus with a
non-existant file, the result is abort():

c-lex.c:
223       if (! cpp_start_read (&parse_in, filename))
224         abort ();

I don't think this is appropriate (eventhough the driver should ensure the
input file exists, when debugging an ICE is quite strange), I think much
better would be to exit with some non-zero code at this point.
That's actually what cppmain.c does as well:

cppmain.c:
  if (! cpp_start_read (pfile, CPP_OPTION (pfile, in_fname)))
    return (FATAL_EXIT_CODE);


Also, gcc/configure.in has
AC_ARG_ENABLE(c-cpplib,
[  --enable-c-cpplib       link cpplib directly into C and C++ compilers
                           (HIGHLY EXPERIMENTAL).],
[if test x$enable_c_cpplib != xyes; then
  maybe_cpplib=
fi]
)
IMHO the comment should speak about --disable-c-cpplib now that it is the
default and HIGHLY EXPERIMENTAL is probably not appropriate either.

	Jakub


More information about the Gcc-bugs mailing list