Bug 76730 - [patch] dynamic_bitset broken in devel/boost 1.32
Summary: [patch] dynamic_bitset broken in devel/boost 1.32
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thierry Thomas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-26 22:10 UTC by Mark A. Wicks
Modified: 2005-02-12 21:14 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark A. Wicks 2005-01-26 22:10:12 UTC
Having BOOST_NO_INCLASS_MEMBER_INITIALIZATION defined in bsd.hpp
causes boost to use anonymous enums.  Anonymous enums are considered
to be different types in gcc 3.4.0 even when declared identically.  As
a result, any ports using dynamic_bitset won't compile.

Fix: 

- #define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
-
  //
  // The BSD <ctype.h> has macros only, no functions:
  //
--- 52,57 ----

Not defining BOOST_NO_INCLASS_MEMBER_INITIALIZATION produces standard
code.  This #define shouldn't be required on compilers that follow
standards.  I don't know if this definition was necessary on older
versions of GCC.--pUkfCoWWxktLU6JD7ObPPOSFGOmhRvVdvbpUKWDNJuCocCtE
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

*** ./bsd.hpp-orig      Wed Jan 26 15:29:17 2005
--- ./bsd.hpp   Wed Jan 26 16:17:59 2005
***************
*** 52,59 ****
  #  define BOOST_NO_CWCTYPE
  #endif
How-To-Repeat: Compile the following program:

#include <boost/dynamic_bitset.hpp>

int main(int, char*[]) {
  boost::dynamic_bitset<> x(2);
  return 0;
}

This produces the following errors:

usr/local/include/boost/dynamic_bitset/dynamic_bitset.hpp: In constructor `boost::dynamic_bitset<Block, Allocator>::dynamic_bitset(size_t, long unsigned int, const Allocator&) [with Block = long unsigned int, Allocator = std::allocator<long unsigned int>]':
foo.cc:4:   instantiated from here
/usr/local/include/boost/dynamic_bitset/dynamic_bitset.hpp:541: warning: comparison between `enum boost::dynamic_bitset<long unsigned int, std::allocator<long unsigned int> >::<anonymous>' and `enum boost::dynamic_bitset<long unsigned int, std::allocator<long unsigned int> >::<anonymous>'
foo.cc:4:   instantiated from here
/usr/local/include/boost/dynamic_bitset/dynamic_bitset.hpp:548: error: no matching function for call to `make_non_const(boost::dynamic_bitset<long unsigned int, std::allocator<long unsigned int> >::<anonymous enum>)'
Comment 1 Sergey Matveychuk freebsd_committer 2005-01-27 17:58:00 UTC
Dear maintainer!

Take the PR into account please.
-- 
Sem.
Comment 2 Thierry Thomas freebsd_committer 2005-01-31 20:24:10 UTC
Please notify me when this PR will be committed (or rejected): I'm
waiting for it to handle PR ports/76738.

Regards,
--
Th. Thomas.
Comment 3 Sergey Matveychuk freebsd_committer 2005-02-01 10:31:37 UTC
Sorry for the delay -- real life is very time consuming these days (will
get better starting from the end of February :-)

Please use the following (equivalent) patch instead (obtained from the
Boost CVS repository after some discussion on the boost mailing list):

(I would have tested the monotone compilation, but the master site is
not reachable :(

diff -ruN boost.orig/files/patch-boost::config::platform:bsd.hpp boost/files/patch-boost::config::platform:bsd.hpp
--- boost.orig/files/patch-boost::config::platform:bsd.hpp	Fri Dec 24 13:23:12 2004
+++ boost/files/patch-boost::config::platform:bsd.hpp	Sat Feb  5 12:54:07 2005
@@ -1,25 +1,14 @@
---- boost/config/platform/bsd.hpp.orig	Fri Feb 27 14:13:00 2004
-+++ boost/config/platform/bsd.hpp	Wed Dec 15 16:01:21 2004
-@@ -39,9 +39,20 @@
- #endif
- 
+--- boost/config/platform/bsd.hpp.orig	Sat Feb  5 12:53:03 2005
++++ boost/config/platform/bsd.hpp	Sat Feb  5 12:53:46 2005
+@@ -41,8 +41,9 @@
  //
--// No wide character support in the BSD header files:
-+// Enable wide character support on FreeBSD 5 and above
+ // No wide character support in the BSD header files:
  //
 -#define BOOST_NO_CWCHAR
-+#if defined(__FreeBSD__) && (__FreeBSD__ >= 5)
-+#  undef BOOST_NO_CWCHAR
-+#  undef BOOST_NO_SWPRINTF
-+#  undef BOOST_NO_CWCTYPE
-+#  undef BOOST_DEDUCED_TYPENAME
-+#else
+-
++#if !(defined(__FreeBSD__) && (__FreeBSD__ >= 5))
 +#  define BOOST_NO_CWCHAR
-+#  define BOOST_NO_SWPRINTF
-+#  define BOOST_NO_CWCTYPE
 +#endif
-+ 
-+#define BOOST_NO_INCLASS_MEMBER_INITIALIZATION
- 
  //
  // The BSD <ctype.h> has macros only, no functions:
+ //
Comment 4 Thierry Thomas freebsd_committer 2005-02-05 17:54:17 UTC
State Changed
From-To: open->feedback


Waiting for maintainer's approval. 



Comment 5 Thierry Thomas freebsd_committer 2005-02-05 17:54:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->thierry


Take it.
Comment 6 Thierry Thomas freebsd_committer 2005-02-12 21:12:05 UTC
State Changed
From-To: feedback->closed


I have committed the patch submitted by Simon Barner (maintainer) 
which has been obtained from the Boost CVS repository. 

Thanks for your submission!