public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* linux libio status
@ 1997-10-14 23:23 Joe Buck
  1997-10-15  0:06 ` Richard Henderson
  1997-10-15  0:52 ` Olivier Galibert
  0 siblings, 2 replies; 19+ messages in thread
From: Joe Buck @ 1997-10-14 23:23 UTC (permalink / raw)
  To: egcs team

Well, it looks like we *really* need to clean out the old 
$prefix/include/g++ before doing make install, because it seemed
that everyone missed this problem ('cause they all had leftover
headers that were getting used).

Thanks to Mumit's suggestion, I blew away everything under $prefix
and re-installed on my Linux Red Hat 4.2 box -- 971008 plus HJ's
patch adding weak symbols.  The good news is that the failing
test posted here recently now passes.  The problem is that we now get a
number of warnings, even for "hello world".

The problem is this: we are now using the /usr/include/libio.h
rather than the one from egcs.  The version included with Red Hat
(libc 5.3.12) has the text

#ifndef NULL
#if !defined(__cplusplus) || defined(__GNUC__)
#define NULL ((void*)0)
#else
#define NULL (0)
#endif
#endif

Now, egcs has been fixed so that C++ no longer freely casts (void *)0
to other pointers, so this now gives lots of warnings.

e.g. for "hello world", or
-----
#include <iostream.h>

main () {
        cout << "Hello, world\n";
}
-----

In file included from /usr/local/egcs/include/g++/iostream.h:31,
                 from hello.cc:1:
/usr/local/egcs/include/g++/streambuf.h:394: warning: invalid type `void
*' for default argument to `ios *'
In file included from hello.cc:1:
/usr/local/egcs/include/g++/iostream.h:50: warning: invalid type `void *'
for default argument to `ostream *'
/usr/local/egcs/include/g++/iostream.h: In method `int ostream::opfx()':
/usr/local/egcs/include/g++/iostream.h:53: warning: implicit declaration
of function `int _IO_flockfile(...)'
/usr/local/egcs/include/g++/iostream.h: In method `void ostream::osfx()':
/usr/local/egcs/include/g++/iostream.h:54: warning: implicit declaration
of function `int _IO_funlockfile(...)'
/usr/local/egcs/include/g++/iostream.h: At top level:
/usr/local/egcs/include/g++/iostream.h:123: warning: invalid type `void *'
for default argument to `ostream *'
/usr/local/egcs/include/g++/iostream.h:230: warning: invalid type `void *'
for default argument to `ostream *'

If we force NULL to be 0 as in
c++ -DNULL=0 hello.cc

we are down to

/usr/local/egcs/include/g++/iostream.h: In method `int ostream::opfx()':
In file included from hello.cc:1:
/usr/local/egcs/include/g++/iostream.h:53: warning: implicit declaration
of function `int _IO_flockfile(...)'
/usr/local/egcs/include/g++/iostream.h: In method `void ostream::osfx()':
/usr/local/egcs/include/g++/iostream.h:54: warning: implicit declaration
of function `int _IO_funlockfile(...)'

We need to silence these warnings.  For the NULL, I suggest a global
s/NULL/0/ in the C++ iostreams headers.  There is no reason to write
NULL, it is just a source of problems like this (*especially* since
we have changed C++ to be strict about void*).

I don't know where the missing declarations should go; perhaps HJ has
an idea.  One possibility is to just define them to null when the
older library is in use.  The new libio.h could have its locking
functions split off into a new header, which always gets installed.
Or something; I'm sure HJ and/or Ulrich have better ideas.

Joe




^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~1997-10-16 15:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-10-14 23:23 linux libio status Joe Buck
1997-10-15  0:06 ` Richard Henderson
1997-10-15  0:52 ` Olivier Galibert
1997-10-15  8:25   ` [ECGS] " chip
1997-10-15 11:12   ` Peter Seebach
1997-10-15 20:16     ` Joe Buck
1997-10-15 11:12   ` Joe Buck
1997-10-15 12:10     ` Olivier Galibert
1997-10-15 16:51       ` [ECGS] " chip
1997-10-15 20:16       ` Joe Buck
1997-10-15 20:16         ` Olivier Galibert
1997-10-16 12:53           ` Pal Engstad
     [not found]   ` <199710151419.JAA20162.cygnus.egcs@monolith.solon.com>
1997-10-15 16:51     ` Jason Merrill
1997-10-15 20:16       ` Peter Seebach
1997-10-15 22:29         ` Jason Merrill
1997-10-16  8:31           ` Peter Seebach
1997-10-16 15:19             ` Jason Merrill
1997-10-16 12:53               ` Peter Seebach
1997-10-16 15:19       ` Paul Koning

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).