Boost logo

Boost :

From: Lars Gullik Bjønnes (larsbj_at_[hidden])
Date: 2003-10-22 19:10:06


I have to do these changes to boost (on the parts used by LyX) to make
the boost libs compile cleanly with Gcc 3.4.
In addtion to the below I changed config/compilers/gcc.hpp, but I
guess you do not want that until gcc 3.4 is acually released.

I also get one warining about "expression is always false due to
limited range of type" (or very similar). In regex_compile.hpp l. 73:

   if((traits_size_type)(traits_uchar_type)c >= 256)

I have no idea what to do with that one.

To the hunks:

Missing header:

Index: boost/format/feed_args.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/format/feed_args.hpp,v
retrieving revision 1.16
diff -u -p -r1.16 feed_args.hpp
--- boost/format/feed_args.hpp 16 Sep 2003 16:53:34 -0000 1.16
+++ boost/format/feed_args.hpp 22 Oct 2003 23:59:17 -0000
@@ -27,6 +27,8 @@
 #include <boost/format/detail/msvc_disambiguater.hpp>
 #include <boost/throw_exception.hpp>
 
+#include <cassert>
+
 namespace boost {
 namespace io {
 namespace detail {

Warnings about "statement with no-effect", I shut it up with a (void):
(I'll check with the gcc list if this warning is intended.)

Index: boost/regex/v4/perl_matcher_non_recursive.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/regex/v4/perl_matcher_non_recursive.hpp,v
retrieving revision 1.16
diff -u -p -r1.16 perl_matcher_non_recursive.hpp
--- boost/regex/v4/perl_matcher_non_recursive.hpp 4 Oct 2003 11:28:56 -0000 1.16
+++ boost/regex/v4/perl_matcher_non_recursive.hpp 22 Oct 2003 23:59:17 -0000
@@ -175,7 +175,7 @@ void perl_matcher<BidiIterator, Allocato
       backup_state = reinterpret_cast<saved_state*>(reinterpret_cast<char*>(stack_base)+BOOST_REGEX_BLOCKSIZE);
       saved_extra_block* block = static_cast<saved_extra_block*>(backup_state);
       --block;
- new (block) saved_extra_block(m_stack_base, m_backup_state);
+ (void)new (block) saved_extra_block(m_stack_base, m_backup_state);
       m_stack_base = stack_base;
       m_backup_state = block;
    }
@@ -195,7 +195,7 @@ inline void perl_matcher<BidiIterator, A
       pmp = static_cast<saved_matched_paren<BidiIterator>*>(m_backup_state);
       --pmp;
    }
- new (pmp)saved_matched_paren<BidiIterator>(index, sub);
+ (void)new (pmp)saved_matched_paren<BidiIterator>(index, sub);
    m_backup_state = pmp;
 }
 
@@ -210,7 +210,7 @@ inline void perl_matcher<BidiIterator, A
       pmp = m_backup_state;
       --pmp;
    }
- new (pmp)saved_state(saved_type_recurse);
+ (void)new (pmp)saved_state(saved_type_recurse);
    m_backup_state = pmp;
 }
 
@@ -225,7 +225,7 @@ inline void perl_matcher<BidiIterator, A
       pmp = static_cast<saved_assertion<BidiIterator>*>(m_backup_state);
       --pmp;
    }
- new (pmp)saved_assertion<BidiIterator>(positive, ps, position);
+ (void)new (pmp)saved_assertion<BidiIterator>(positive, ps, position);
    m_backup_state = pmp;
 }
 
@@ -240,7 +240,7 @@ inline void perl_matcher<BidiIterator, A
       pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
       --pmp;
    }
- new (pmp)saved_position<BidiIterator>(ps, position, saved_state_alt);
+ (void)new (pmp)saved_position<BidiIterator>(ps, position, saved_state_alt);
    m_backup_state = pmp;
 }
 
@@ -255,7 +255,7 @@ inline void perl_matcher<BidiIterator, A
       pmp = static_cast<saved_position<BidiIterator>*>(m_backup_state);
       --pmp;
    }
- new (pmp)saved_position<BidiIterator>(ps, position, saved_state_non_greedy_long_repeat);
+ (void)new (pmp)saved_position<BidiIterator>(ps, position, saved_state_non_greedy_long_repeat);
    m_backup_state = pmp;
 }
 
@@ -270,7 +270,7 @@ inline void perl_matcher<BidiIterator, A
       pmp = static_cast<saved_repeater<BidiIterator>*>(m_backup_state);
       --pmp;
    }
- new (pmp)saved_repeater<BidiIterator>(i, s, position);
+ (void)new (pmp)saved_repeater<BidiIterator>(i, s, position);
    m_backup_state = pmp;
 }
 
@@ -285,7 +285,7 @@ inline void perl_matcher<BidiIterator, A
       pmp = static_cast<saved_single_repeat<BidiIterator>*>(m_backup_state);
       --pmp;
    }
- new (pmp)saved_single_repeat<BidiIterator>(c, r, last_position, id);
+ (void)new (pmp)saved_single_repeat<BidiIterator>(c, r, last_position, id);
    m_backup_state = pmp;
 }

Same patch I sent to the list earlier. Response was that it will be
included. The (unsinged char) cast is new though:
 
Index: libs/regex/src/cpp_regex_traits.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/regex/src/cpp_regex_traits.cpp,v
retrieving revision 1.36
diff -u -p -r1.36 cpp_regex_traits.cpp
--- libs/regex/src/cpp_regex_traits.cpp 13 Oct 2003 11:45:11 -0000 1.36
+++ libs/regex/src/cpp_regex_traits.cpp 22 Oct 2003 23:59:19 -0000
@@ -157,9 +157,9 @@ parser_buf<charT, traits>::seekpos(pos_t
       return pos_type(off_type(-1));
    std::ptrdiff_t size = this->egptr() - this->eback();
    charT* g = this->eback();
- if(sp <= size)
+ if(off_type(sp) <= size)
    {
- this->setg(g, g + ::std::streamsize(sp), g + size);
+ this->setg(g, g + off_type(sp), g + size);
    }
    return pos_type(off_type(-1));
 }
@@ -234,7 +234,7 @@ message_data<char>::message_data(const s
 #endif
       for(std::size_t j = 0; j < s.size(); ++j)
       {
- syntax_map[s[j]] = (unsigned char)(i);
+ syntax_map[(unsigned char)s[j]] = (unsigned char)(i);
       }
    }
 

Gcc complains about missing initializator.

Index: libs/regex/src/regex.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/regex/src/regex.cpp,v
retrieving revision 1.18
diff -u -p -r1.18 regex.cpp
--- libs/regex/src/regex.cpp 4 Oct 2003 11:29:19 -0000 1.18
+++ libs/regex/src/regex.cpp 22 Oct 2003 23:59:19 -0000
@@ -123,7 +123,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL p
 
 #else
 
-mem_block_cache block_cache = { 0, };
+mem_block_cache block_cache = { 0, 0 };
 
 BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block()
 {

-- 
	Lgb

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk