This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Annoying iostream.h warning messages.
- To: viper at ns2 dot bub dot com (Viper)
- Subject: Re: Annoying iostream.h warning messages.
- From: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Date: Sun, 23 Aug 1998 16:06:17 +0200 (CEST)
- Cc: egcs at cygnus dot com (egcs at cygnus dot com)
| When I use g++ (from egcs-2.91.54, latest snapshot) to compile even a very
| simple "hello world" program, it results in over a page of warning
| messages. This becomes very annoying, especially when trying to debug
| compiler errors for large projects that involve many different files.
...
| -------------------------------------------
| #include <iostream.h>
|
| main()
| {
| cout << "Hello world." << endl;
| }
| -------------------------------------------
...
| In file included from /usr/include/g++/iostream.h:31,
| from test.cc:1:
| /usr/include/g++/streambuf.h:403: warning: invalid type `void *' for default argument to `ios *'
...
You are using the wrong iostream.h.
I suppose you use the headers of gcc-2.8 or 2.7, not egcs.
If you use a -I/usr/include/g++ then just get rid of it :).
I tested this with one of the latest egcs versions, having
a fake iostream.h in /usr/include/g++/iostream.h, and it worked:
the correct iostream.h was used
(from /usr/local/egcs-cvs/include/g++/iostream.h in my case,
which is only 272 lines long).
Maybe you installed egcs with --prefix=/usr
and then re-installed your "system" compiler over it?
That is a bad idea: it would overwrite the stuff in
/usr/include/g++
You can only have one compiler installed with --prefix=/usr
Hope this helps,
--
Carlo Wood <carlo@runaway.xs4all.nl>
PS You might want to get used to including <iostream>
without '.h'.