This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [RFC] : Compiling libstdc++ with warnings on
Hi Chris,
and thanks!
>I attach to this mail my current patch.
>
Maybe ;)
> This isn't final, but it shows
>(I believe) all the "trivial" required changes. In the main this is just
>removing the names of parameters which are never used, or marking things
>__attribute__((unused)).
>
>After that very large, but fairly uninteresting patch, the following
>things remain (for -Wall)
>
>1) Almost everything in tr1::array, as tr1::array<int,3> a = {1,2,3}
>produces a warning about missing braces, it "should be" {{1,2,3}}. This
>is PR25137.
>
>
I followed a bit your submission. I gather that no action is immediately
needed on the library side?!? I want to understand the issue better, anyway.
>2) Some things using bits/istream_iterator.h, in particular this little
>piece of code. The construct on line 63 doesn't construct _M_value (one
>of the elements). We've had this kind of thing before (we don't define
>something, because it would get defined before it was ever used). I
>tried adding a definition for it and can't measure any problem (mainly
>as you are dealing with streams here.
>
>
Yes, seems trivial, you are welcome to add your proposed fix to the
final patch.
>3) FAIL: ext/pb_assoc/example/mapping_level.cc (test for excess errors)
>
>/Users/caj/gccdev/trunkobj/powerpc-apple-darwin8.3.0/libstdc++-v3/include/ext/pb_assoc/detail/value_type_adapter/it_value_type_traits.hpp:117:
>warning: dereferencing type-punned pointer will break strict-aliasing rules
>
>I have no idea what this piece of code even is.
>
>
Humm, can be very nasty. Now a lot more alias analysis is performed and
exploited aggressively, in case the warning is real, not false, we can
end up with wrong code (see my recent patch to set / multiset, for
example). I hope Benjamin can help...
>4) FAIL: tr1/4_metaprogramming/type_properties/is_empty/is_empty.cc
>../../../../trunk/libstdc++-v3/testsuite/tr1/4_metaprogramming/type_properties/is_empty/is_empty.cc:40:
>warning: 'class NonEmptyClassTwo' has virtual functions but non-virtual
>destructor
>/Users/caj/gccdev/trunkobj/powerpc-apple-darwin8.3.0/libstdc++-v3/include/tr1/type_traits:
>In instantiation of 'std::tr1::__is_empty_helper<NonEmptyClassTwo,
>false>::__second<NonEmptyClassTwo>':
>
>
Seems trivial, I'll fix it later today.
>Pushing on to -Wextra
>
>Many files in 22_locale/time_get & 22_locale/time_put like:
>./../../../trunk/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc:
>In function 'void test01()':
>../../../../trunk/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc:35:
>warning: missing initializer for member 'tm::tm_gmtoff'
>../../../../trunk/libstdc++-v3/testsuite/22_locale/time_put/put/char/1.cc:35:
>warning: missing initializer for member 'tm::tm_zone'
>
>>From lines like: tm time1 = { 0, 0, 12, 4, 3, 71, 0, 93, 0 };
>
>
Same warning triggered by tr1::array, I understand.
Paolo.