This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Warnings with <iostream>
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Warnings with <iostream>
- From: Richard Atterer <atterer at informatik dot tu-muenchen dot de>
- Date: Mon, 1 Nov 1999 12:40:43 +0100
Hello,
this is just to follow up to my own posting from last week, when I
reported crashes when outputting zero-length strings - this is indeed
fixed in the latest CVS sources!
However, not all the warnings when #include'ing <iostream> have been
eliminated. With the CVS sources from Oct 28 and these compiler flags:
-Wall -W -Wpointer-arith -Wbad-function-cast -Wconversion
-Wmissing-prototypes -Woverloaded-virtual -Winline -g -DVERSION_NR=""
-DDEBUG
I get the following two warnings:
In file included from {libstdc++dir}/include/g++-v3/bits/std_string.h:46,
from {libstdc++dir}/include/g++-v3/bits/localefwd.h:39,
from {libstdc++dir}/include/g++-v3/bits/std_ios.h:49,
from {libstdc++dir}/include/g++-v3/bits/std_ostream.h:37,
from {libstdc++dir}/include/g++-v3/bits/std_iostream.h:38,
from {libstdc++dir}/include/g++-v3/iostream:2,
from myprog.cc:12:
{libstdc++dir}/include/g++-v3/bits/basic_string.h: In instantiation of
`basic_string<char,char_traits<char>,allocator<char> >':
{libstdc++dir}/include/g++-v3/bits/string.tcc:509: instantiated from
here
{libstdc++dir}/include/g++-v3/bits/basic_string.h:116: warning:
negative integer implicitly converted to unsigned type
{libstdc++dir}/include/g++-v3/bits/basic_string.h: In instantiation of
`basic_string<__wchar_t,char_traits<__wchar_t>,allocator<__wchar_t> >':
{libstdc++dir}/include/g++-v3/bits/string.tcc:514: instantiated from
here
{libstdc++dir}/include/g++-v3/bits/basic_string.h:116: warning:
negative integer implicitly converted to unsigned type
The corresponding part of basic_string.h looks like this:
// NB: This is an unsigned type, and thus represents the maximum
// size that the allocator can hold.
static const size_type npos = -1;
Cheers,
Richard
--
__ _
|_) /| Richard Atterer (currently at Queen's University, Belfast, NI)
| \/¯| http://www.in.tum.de/~atterer/
¯ ´` ¯