Article View: gnu.gcc.bug
Article #1955GNU C preprocessor 1.30 bug and a fix
From: "Nelson H.F. Beebe"
Date: Fri, 18 Nov 1988 15:22
Date: Fri, 18 Nov 1988 15:22
26 lines
1312 bytes
1312 bytes
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);
-------
Technical Details
Message-ID:
<12447551485.30.BEEBE@SCIENCE.UTAH.EDU>Path:
arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!SCIENCE.UTAH.EDU!BeebeShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!mcdchg!rutgers!tut.cis.ohio-state.edu!SCIENCE.UTAH.EDU!Beebe
From: Beebe@SCIENCE.UTAH.EDU ("Nelson H.F. Beebe")
Newsgroups: gnu.gcc.bug
Subject: GNU C preprocessor 1.30 bug and a fix
Message-ID: <12447551485.30.BEEBE@SCIENCE.UTAH.EDU>
Date: 18 Nov 88 15:22:29 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 26