/usr/include/curses.h not fixed on sparc-sun-solaris2.5.1

Paul Eggert eggert@twinsun.com
Thu Apr 23 01:07:00 GMT 1998

   Date: Tue, 21 Apr 1998 12:03:06 +0200 (MET DST)
   From: Manfred Hollstein <manfred@s-direktnet.de>

   This change broke fixing header files on sparc-sun-solaris2.5.1....
   /usr/include/curses.h's broken `typedef char bool;'
   definition will no longer be fixed.

Why is it necessary to modify that definition?  As far as I know, the
unmodified definition elicits only a single harmless warning with GCC

   Was this change intentional?

Yes.  A common problem in Solaris GCC installations was the use of GCC
compilers with the wrong versions of Solaris.  The slightest change to
Solaris include files (e.g. by installing recommended patches from
Sun) meant that you had to rebuild GCC -- an error-prone process that
was often neglected.  Starting with Solaris 2.5 and GCC 2.8 this no
longer became necessary, because GCC 2.8 and later no longer ``fixes'' any
of the Solaris include files.

I suppose we could modify the GCC build procedure to also ``fix''
curses.h to avoid that harmless warning, but I'm not sure it's worth
the installation problem.  The warning is issued only in rare cases
(namely when using curses.h in C++), and it doesn't hurt anything,
whereas the installation problem can cause compilation to fail,
sometimes in subtle ways.

If the harmless warning is really bothering you, then I suggest that
it be turned off at the C++ compiler level, not at the fixincludes level.
That is, it seems to me that

	extern "C" {
	  typedef char bool;
	  extern int foo(bool);

should not be an error in C++, since bool is not a builtin type in C.
But perhaps a C++ expert can correct me here.

   Shouldn't the [[0-4]] include 5 as well?

No, because Solaris 2.4 and earlier have other glitches in include
files that need fixing; I forget what they were.  Those glitches
aren't present in 2.5 and later.  2.4 and earlier are relatively
unimportant these days, so it's not worth worrying about them.

More information about the Gcc-bugs mailing list