Warnings with -W

Developers
2008-07-19
2013-05-13
  • Mario Larouche
    Mario Larouche
    2008-07-19

    I noticed that there's quite a few warnings if you compiler STLport 5.1.5 using -W with g++ 3.4.6 (RHEL4 computer).
    Is this expected?  (See below for a sample of the messages I get)

    The same occurs when I compile my application which uses STLport.
    It is a policy for us to compile all of our code cleanly (warning free) when using -Wall and -W.

    Any easy ways to avoid those warnings and still keep -Wall -W ?

    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/dll_main.o ../../src/dll_main.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/fstream.o ../../src/fstream.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/strstream.o ../../src/strstream.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/sstream.o ../../src/sstream.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/ios.o ../../src/ios.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/stdio_streambuf.o ../../src/stdio_streambuf.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/istream.o ../../src/istream.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/ostream.o ../../src/ostream.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/iostream.o ../../src/iostream.cpp
    ../../stlport/stl/_locale.h: In instantiation of `bool stlp_std::_HasFacet(const stlp_std::locale&, const _Facet*) [with _Facet = stlp_std::codecvt<char, char, mbstate_t>]':
    ../../stlport/stl/_locale.h:303:   instantiated from `bool stlp_std::has_facet(const stlp_std::locale&) [with _Facet = stlp_std::codecvt<char, char, mbstate_t>]'
    ../../stlport/stl/_fstream.c:715:   instantiated from `void stlp_std::basic_filebuf<_CharT, _Traits>::_M_setup_codecvt(const stlp_std::locale&, bool) [with _CharT = char, _Traits = stlp_std::char_traits<char>]'
    ../../stlport/stl/_fstream.c:63:   instantiated from `stlp_std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = char, _Traits = stlp_std::char_traits<char>]'
    ../../src/iostream.cpp:171:   instantiated from here
    ../../stlport/stl/_locale.h:312: warning: unused parameter '__facet'
    ../../stlport/stl/_locale.h: In instantiation of `_Facet* stlp_std::_UseFacet(const stlp_std::locale&, const _Facet*) [with _Facet = stlp_std::codecvt<char, char, mbstate_t>]':
    ../../stlport/stl/_locale.h:288:   instantiated from `const _Facet& stlp_std::use_facet(const stlp_std::locale&) [with _Facet = stlp_std::codecvt<char, char, mbstate_t>]'
    ../../stlport/stl/_fstream.c:716:   instantiated from `void stlp_std::basic_filebuf<_CharT, _Traits>::_M_setup_codecvt(const stlp_std::locale&, bool) [with _CharT = char, _Traits = stlp_std::char_traits<char>]'
    ../../stlport/stl/_fstream.c:63:   instantiated from `stlp_std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = char, _Traits = stlp_std::char_traits<char>]'
    ../../src/iostream.cpp:171:   instantiated from here
    ../../stlport/stl/_locale.h:316: warning: unused parameter '__facet'
    ../../stlport/stl/_locale.h: In instantiation of `bool stlp_std::_HasFacet(const stlp_std::locale&, const _Facet*) [with _Facet = stlp_std::codecvt<wchar_t, char, mbstate_t>]':
    ../../stlport/stl/_locale.h:303:   instantiated from `bool stlp_std::has_facet(const stlp_std::locale&) [with _Facet = stlp_std::codecvt<wchar_t, char, mbstate_t>]'
    ../../stlport/stl/_fstream.c:715:   instantiated from `void stlp_std::basic_filebuf<_CharT, _Traits>::_M_setup_codecvt(const stlp_std::locale&, bool) [with _CharT = wchar_t, _Traits = stlp_std::char_traits<wchar_t>]'
    ../../stlport/stl/_fstream.c:63:   instantiated from `stlp_std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = wchar_t, _Traits = stlp_std::char_traits<wchar_t>]'
    ../../src/iostream.cpp:189:   instantiated from here
    ../../stlport/stl/_locale.h:312: warning: unused parameter '__facet'
    ../../stlport/stl/_locale.h: In instantiation of `_Facet* stlp_std::_UseFacet(const stlp_std::locale&, const _Facet*) [with _Facet = stlp_std::codecvt<wchar_t, char, mbstate_t>]':
    ../../stlport/stl/_locale.h:288:   instantiated from `const _Facet& stlp_std::use_facet(const stlp_std::locale&) [with _Facet = stlp_std::codecvt<wchar_t, char, mbstate_t>]'
    ../../stlport/stl/_fstream.c:716:   instantiated from `void stlp_std::basic_filebuf<_CharT, _Traits>::_M_setup_codecvt(const stlp_std::locale&, bool) [with _CharT = wchar_t, _Traits = stlp_std::char_traits<wchar_t>]'
    ../../stlport/stl/_fstream.c:63:   instantiated from `stlp_std::basic_filebuf<_CharT, _Traits>::basic_filebuf() [with _CharT = wchar_t, _Traits = stlp_std::char_traits<wchar_t>]'
    ../../src/iostream.cpp:189:   instantiated from here
    ../../stlport/stl/_locale.h:316: warning: unused parameter '__facet'
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/codecvt.o ../../src/codecvt.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/collate.o ../../src/collate.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/ctype.o ../../src/ctype.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/monetary.o ../../src/monetary.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/num_get.o ../../src/num_get.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/num_put.o ../../src/num_put.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/num_get_float.o ../../src/num_get_float.cpp
    ../../stlport/stl/_locale.h: In instantiation of `_Facet* stlp_std::_UseFacet(const stlp_std::locale&, const _Facet*) [with _Facet = stlp_std::ctype<char>]':
    ../../stlport/stl/_locale.h:288:   instantiated from `const _Facet& stlp_std::use_facet(const stlp_std::locale&) [with _Facet = stlp_std::ctype<char>]'
    ../../src/num_get_float.cpp:757:   instantiated from here
    ../../stlport/stl/_locale.h:316: warning: unused parameter '__facet'
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/num_put_float.o ../../src/num_put_float.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/numpunct.o ../../src/numpunct.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/time_facets.o ../../src/time_facets.cpp
    c++ -pthread -fexceptions -fident  -fPIC -g -fno-inline -fuse-cxa-atexit -Wall -W  -D_REENTRANT -D_STLP_REAL_LOCALE_IMPLEMENTED -D_GNU_SOURCE -I../../stlport  -c -o obj/gcc/so_g/messages.o ../../src/messages.cpp
    ../../stlport/stl/_algobase.c: In instantiation of `_ForwardIter stlp_priv::__lower_bound(_ForwardIter, _ForwardIter, const _Tp&, _Compare1, _Compare2, _Distance*) [with _ForwardIter = const size_t*, _Tp = size_t, _Compare1 = stlp_std::less<size_t>, _Compare2 = stlp_std::less<size_t>, _Distance = ptrdiff_t]':
    ../../stlport/stl/_hashtable.c:69:   instantiated from `static size_t stlp_priv::_Stl_prime<_Dummy>::_S_next_size(size_t) [with _Dummy = bool]'
    ../../stlport/stl/_hashtable.h:620:   instantiated from `void stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::_M_initialize_buckets(size_t) [with _Val = stlp_std::pair<const int, void*>, _Key = int, _HF = stlp_std::hash<int>, _Traits = stlp_priv::_HashMapTraitsT<stlp_std::pair<const int, void*> >, _ExK = stlp_priv::_Select1st<stlp_std::pair<const int, void*> >, _EqK = stlp_std::equal_to<int>, _All = stlp_std::allocator<stlp_std::pair<const int, void*> >]'
    ../../stlport/stl/_hashtable.h:359:   instantiated from `stlp_std::hashtable<_Val, _Key, _HF, _Traits, _ExK, _EqK, _All>::hashtable(size_t, const _HF&, const _EqK&, const typename stlp_std::_Alloc_traits<_Val, _All>::allocator_type&) [with _Val = stlp_std::pair<const int, void*>, _Key = int, _HF = stlp_std::hash<int>, _Traits = stlp_priv::_HashMapTraitsT<stlp_std::pair<const int, void*> >, _ExK = stlp_priv::_Select1st<stlp_std::pair<const int, void*> >, _EqK = stlp_std::equal_to<int>, _All = stlp_std::allocator<stlp_std::pair<const int, void*> >]'
    ../../stlport/stl/_hash_map.h:96:   instantiated from `stlp_std::hash_map<_Key, _Tp, _HashFcn, _EqualKey, _Alloc>::hash_map() [with _Key = int, _Tp = void*, _HashFcn = stlp_std::hash<int>, _EqualKey = stlp_std::equal_to<int>, _Alloc = stlp_std::allocator<stlp_std::pair<const int, void*> >]'
    ../../src/message_facets.h:75:   instantiated from here
    ../../stlport/stl/_algobase.c:374: warning: unused parameter '__comp2'