FILE *stdin, *stdout, *stderr are no longer declared constant in stdio.h. They have been constant in previous versions of RHL (as well as just about every other OS on the planet). This breaks all sorts of code. A trivial example: --------------- #include <stdio.h> FILE *logf = stderr; int main(void) { fprintf(logf, "This bites.\n"); } ---------------
Yes, glibc-2.1 requires programs to be re-written as below. Some of the internals of the stdio structures have changed making compatibility with glibc-2.0 more problematic than it would be otherwise. The change below permits the loader to fix certain of these problems and prevents the situation from happening again. (At least I think that's the correct explanation ...) #include <stdio.h> FILE *logf; int main(void) { logf = stderr; fprintf(logf, "This bites.\n"); }
*** Bug 3253 has been marked as a duplicate of this bug. *** In glibc-devel-2.1.1-6 a gratuitous change to stdio.h/libio.h was made which prevents stdin, stderr and stdout from being used as initializers. The code below complies on every system I've tried *except* the latest glibc-devel-2.1.1. #include <stdio.h> FILE *x = stdout; An (unnacceptable) workaround is to use _IO_stdout.
*** Bug 3742 has been marked as a duplicate of this bug. *** The change of stderr in the standard include file /usr/include/stdio.h from #define stderr _IO_stderr in Redhat 5.2 to: extern FILE *stderr in Rh 6.0 may cause problems in older programs that expect the normal definition for stderr.