[gnu.gcc.bug] GNU C preprocessor 1.30 bug and a fix

Beebe@SCIENCE.UTAH.EDU ("Nelson H.F. Beebe") (11/18/88)

On Sun OS x.x, (char*)NULL in place of "" as an arg to a library
routine usually precipitates a core dump.  The gcc preprocessor
1.30 has such a bug which can be exhibited merely by "gcc -E
foo.c", for any foo.c file, even a one liner.  The fix is
fortunately easy:

*** cccp.c.1.30	Wed Nov 16 08:33:45 1988
--- cccp.c	Thu Nov 17 14:18:04 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);
-------