This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


On Thu, 23 April 1998, 00:00:24, eggert@twinsun.com wrote:

 >    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
 > 2.8.1.
 > 
 >    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.

Oh yeah, I've just in the process of doing this - yesterday I got a
Solaris 2.6 installation and nearly no package can be compiled using
the 2.5.1 compilers :-(

 > 
 > 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.

Sorry to have bothered you, I just recognized, gcc actually only emits
a warning, while current egcs snapshots treat this as an error:

$ ./xgcc -B./ -c ../t.cc 
In file included from ../t.cc:1:
/usr/include/curses.h:69: abstract declarator used as declaration
$ echo $?
1
$ ./xgcc --version
egcs-2.91.24
$ gcc -c ../t.cc 
In file included from ../t.cc:1:
/usr/include/curses.h:69: warning: abstract declarator used as declaration
$ gcc --version
2.8.1

But, the question now is, who's right? Is it an error or not?

manfred


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]