preprocessor/556: cpplib uses freed file descriptors

cato@df.lth.se cato@df.lth.se
Tue Sep 19 21:46:00 GMT 2000


>Number:         556
>Category:       preprocessor
>Synopsis:       cpplib uses freed file descriptors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 19 21:46:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Krister Walfridsson
>Release:        2.96 (ss-20000918)
>Organization:
>Environment:
i386-unknown-netbsd1.5 (a.out)
>Description:
cpplib from ss-20000918 tries to use a filedescriptor fd == -1 when compiling the following small program:

--- /dev/null   Wed Sep 20 04:59:26 2000
+++ foo.c       Wed Sep 20 06:39:57 2000
@@ -0,0 +1,3 @@
+#include "foo.h"
+#undef FOO
+#include "foo.h"

--- /dev/null   Wed Sep 20 04:59:26 2000
+++ foo.h       Wed Sep 20 06:40:00 2000
@@ -0,0 +1,3 @@
+#ifndef        FOO
+#define        FOO
+#endif

Compilation gives the error:
> gcc foo.c
foo.c:3:17: foo.h: Bad file descriptor
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-bugs mailing list