This is the mail archive of the gcc@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: Annoying iostream.h warning messages.


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


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