[1.39.0][Signals2] Release branch test failures

Signals2 is failing five tests on all Mac OS testers. See http://beta.boost.org/development/tests/release/developer/signals2.html Please fix or markup. Thanks, --Beman

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 April 2009, Beman Dawes wrote:
Signals2 is failing five tests on all Mac OS testers.
See http://beta.boost.org/development/tests/release/developer/signals2.html
Please fix or markup.
The failures seem to be due to some bug particular to gcc 4.0 that affects bind. See for example: http://beta.boost.org/development/tests/release/developer/output/Sandia-leop... Has anyone seen this before and have a suggestion for a workaround? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknjQu0ACgkQ5vihyNWuA4UnpwCdEOpuQfLa+giosDG+KyIvPj+q KjkAnRqu0+/WtEvbTWcf6AD8FNCo97P/ =x5vm -----END PGP SIGNATURE-----

Frank Mori Hess:
On Monday 13 April 2009, Beman Dawes wrote:
Signals2 is failing five tests on all Mac OS testers.
See http://beta.boost.org/development/tests/release/developer/signals2.html
Please fix or markup.
The failures seem to be due to some bug particular to gcc 4.0 that affects bind. See for example:
http://beta.boost.org/development/tests/release/developer/output/Sandia-leop...
Has anyone seen this before and have a suggestion for a workaround?
I haven't. What seems to be happening is that when you pass _1, which is inline arg<1> _1() { .. } to A1 const& a1, A1 is properly deduced as a function type, but the const is not dropped, as it should be; instead, the type of a1 becomes arg<1> (&)() const (which is illegal BTW). When this a1 is passed (by value) to boost::bind, it decays to its corresponding pointer type, arg<1> (*)() const - which is also illegal. :-) A workaround is to use pass by value instead of A1 const&.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 April 2009, Peter Dimov wrote:
I haven't. What seems to be happening is that when you pass _1, which is
inline arg<1> _1() { .. }
to A1 const& a1, A1 is properly deduced as a function type, but the const is not dropped, as it should be; instead, the type of a1 becomes arg<1> (&)() const (which is illegal BTW). When this a1 is passed (by value) to boost::bind, it decays to its corresponding pointer type, arg<1> (*)() const - which is also illegal. :-)
A workaround is to use pass by value instead of A1 const&.
Yes, that seems to fix it. If it is at all helpful, I've attached a more minimal test program that triggers the bug with g++ 4.0.1 (compiles fine with g++ 4.3.2). Changing the placeholder to be passed by value makes the compile error go away. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknjjc8ACgkQ5vihyNWuA4VJugCfeqgL5yxusz9WXYnIgbGnoyyW srIAoIr19iV0HLnezajCYI/EU0uZhT56 =9OIZ -----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 April 2009, Peter Dimov wrote:
I haven't. What seems to be happening is that when you pass _1, which is
inline arg<1> _1() { .. }
Also, if I modify bind/placeholders.hpp to define _1 as the usual boost::arg<1> _1; the problems seem to go away. Maybe the defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ <= 400) should be modified to additionally check that __GNUC_PATCHLEVEL__ is less than 1? I ran the bind tests and they still all pass with g++ 4.0.1 with this change.
to A1 const& a1, A1 is properly deduced as a function type, but the const is not dropped, as it should be; instead, the type of a1 becomes arg<1> (&)() const (which is illegal BTW). When this a1 is passed (by value) to boost::bind, it decays to its corresponding pointer type, arg<1> (*)() const - which is also illegal. :-)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknjkcIACgkQ5vihyNWuA4WdIACg3MNMqwlrBRI9cJRvM6M0m3zs HkwAoMKf+0HQL+g7nc05AdygbRmrOXCs =IgII -----END PGP SIGNATURE-----

Frank Mori Hess:
Also, if I modify bind/placeholders.hpp to define _1 as the usual
boost::arg<1> _1;
the problems seem to go away. Maybe the
defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ <= 400)
should be modified to additionally check that __GNUC_PATCHLEVEL__ is less than 1? I ran the bind tests and they still all pass with g++ 4.0.1 with this change.
There is no test for this. You need to verify that bind.hpp still works with precompiled headers when included in more than one translation unit.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 April 2009, Peter Dimov wrote:
There is no test for this. You need to verify that bind.hpp still works with precompiled headers when included in more than one translation unit.
Oh I see. No, it doesn't work in that case, I get errors like: main.o:(.bss+0x8): multiple definition of `(anonymous namespace)::_1' a.o:(.bss+0x8): first defined here collect2: ld returned 1 exit status However, using the definitions of the placeholders provided for MSVC: static boost::arg<1> _1; does work for gcc 4.0.1, for all cases: the bind tests, multiple translation units with a precompiled header, and forwarding of the placeholder as a const reference. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknjpOUACgkQ5vihyNWuA4Wa7wCglMaW6B1AsggUKdToT7GfqPZS aBQAnjbdynw/ZrzPPGjIzbltF7NPfNu8 =wKeh -----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 April 2009, Peter Dimov wrote:
Frank Mori Hess:
However, using the definitions of the placeholders provided for MSVC:
static boost::arg<1> _1;
does work for gcc 4.0.1, for all cases:
It works, but produces annoying "variable not used" warnings. :-)
I haven't seen them, using -Wall and -Wunused-variable. In any case, gcc does have an "unused" attribute which can be used to suppress that warning for specific variables. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknjqYAACgkQ5vihyNWuA4W0UACcCruS/cal7Qodifa/FWWB37dJ CfEAn0RaH/kvbwRJV61vUurf+yPvaBV4 =BxY/ -----END PGP SIGNATURE-----

Frank Mori Hess:
On Monday 13 April 2009, Peter Dimov wrote:
Frank Mori Hess:
However, using the definitions of the placeholders provided for MSVC:
static boost::arg<1> _1;
does work for gcc 4.0.1, for all cases:
It works, but produces annoying "variable not used" warnings. :-)
I haven't seen them, using -Wall and -Wunused-variable.
I remember seeing them with earlier g++ versions; they must have disappeared somewhere along the way. If you want to switch g++ 4.0 to the static placeholder path, that's fine with me.

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 13 April 2009, Peter Dimov wrote:
If you want to switch g++ 4.0 to the static placeholder path, that's fine with me.
Ok, I've done it on trunk with revision 52384. I'll merge it to release in a couple days after some of the tests cycle, unless you tell me not to. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknklQEACgkQ5vihyNWuA4VfrACeMQBFaeOMXOGrq9vtrZsIsELU mVIAoMRe0p9/ue9VSFdusJj0LfwX6Nn9 =mGIZ -----END PGP SIGNATURE-----

On Monday 13 April 2009 22:54:08 Peter Dimov wrote:
It works, but produces annoying "variable not used" warnings. :-)
May not apply here, but I have not seen a BOOST_NOT_USED(var) macro in boost, why not? It is fairly common way of dealing with this warning in cases where you can not remove the variable. Here is one link: http://www.cpptalk.net/suppressing-parameter-not-used-warning-vt21149.html -- Bjørn
participants (4)
-
Beman Dawes
-
Bjørn Roald
-
Frank Mori Hess
-
Peter Dimov