[gnu.gcc.bug] gcc -E never works

karl@typo.umb.edu ("Karl Berry.") (10/21/88)

This is version 1.30, on a Sun 3 running SunOS 3.4.

The following (minimal) program

main() {}

does the following when run with `gcc -v -E':
 /usr/local/gnu/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -Dmc68000 -Dsun -Dunix -D__HAVE_68881__ -Dmc68020 /tmp/y.c
GNU CPP version 1.30
cpp: Error 0 for `(null)'

This is a fairly serious problem. Does anyone have any ideas how to fix it?

Or did I go wrong somewhere in the installation?

Karl.      karl@umb.edu     ...!harvard!umb!karl

cmf@UNIX.CIS.PITTSBURGH.EDU (10/22/88)

Fortunately, that's an easy problem to solve.  I've enclosed a diff for
cccp.c (version 1.30).

				Carl Fongheiser
				University of Pittsburgh
				cmf@unix.cis.pittsburgh.edu


*** cccp.c.orig	Fri Oct 21 18:00:06 1988
--- cccp.c	Fri Oct 21 17:55:48 1988
***************
*** 967,973 ****
  
    /* Now that we know the input file is valid, open the output.  */
  
!   if (out_fname && !strcmp (out_fname, ""))
      out_fname = "stdout";
    else if (! freopen (out_fname, "w", stdout))
      pfatal_with_name (out_fname);
--- 967,973 ----
  
    /* Now that we know the input file is valid, open the output.  */
  
!   if (!out_fname || (out_fname && !strcmp (out_fname, "")))
      out_fname = "stdout";
    else if (! freopen (out_fname, "w", stdout))
      pfatal_with_name (out_fname);