This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
fixincl problem
- To: bkorb at gnu dot org, gcc at gcc dot gnu dot org
- Subject: fixincl problem
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Sun, 21 Jan 2001 19:28:47 +0100
The fixincl program does the equivalent of (in main()):
/* In load_file_data(). */
fclose (stdin);
freopen ("/dev/null", "r", stdin);
Which results in a segmentation fault on the Hurd.
It looks as if this code isn't strictly portable. The current POSIX
draft says in its description of fclose(FILE *stream):
After the call to fclose() any use of STREAM results in undefined
behaviour.
Personally I think load_file_data() shouldn't close the stream that is
passed to it. If people agree, I can come up with a patch that does
implement that.
Mark