Annoying iostream.h warning messages.

Viper viper@ns2.bub.com
Sat Aug 22 22:04:00 GMT 1998


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. 

My older GNU g++ produced no warnings from iostream.h and streambuf.h.  I
have checked that my system include files match the include files provided
by the egcs distribution.  Am I doing something wrong to cause these
warning messages to come up?  Why should the system include files be
causing warnings.  Thanks.

Here is an example file called "test.cc":

-------------------------------------------
#include <iostream.h>

main()
{
  cout << "Hello world." << endl;
}
-------------------------------------------

Now, when I compile it by typing "g++ test.cc -o test", the following
warnings are produced:

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 *'
/usr/include/g++/streambuf.h: In method `streampos streambuf::pubseekoff(streamoff, enum _seek_dir, int = 3)':
/usr/include/g++/streambuf.h:362: warning: implicit declaration of function `int _IO_seekoff(...)'
/usr/include/g++/streambuf.h: In method `streampos streambuf::pubseekpos(streampos, int = 3)':
/usr/include/g++/streambuf.h:364: warning: implicit declaration of function `int _IO_seekpos(...)'
/usr/include/g++/iostream.h: At top level:
In file included from test.cc:1:
/usr/include/g++/iostream.h:50: warning: invalid type `void *' for default argument to `ostream *'
/usr/include/g++/iostream.h: In method `int ostream::opfx()':
/usr/include/g++/iostream.h:53: warning: implicit declaration of function `int _IO_flockfile(...)'
/usr/include/g++/iostream.h: In method `void ostream::osfx()':
/usr/include/g++/iostream.h:54: warning: implicit declaration of function `int _IO_funlockfile(...)'
/usr/include/g++/iostream.h: At top level:
/usr/include/g++/iostream.h:123: warning: invalid type `void *' for default argument to `ostream *'
/usr/include/g++/iostream.h:230: warning: invalid type `void *' for default argument to `ostream *'

Thanks for the help.




More information about the Gcc mailing list