|
Boost : |
From: David Abrahams (abrahams_at_[hidden])
Date: 2000-09-13 18:40:06
With a few relatively easy patches, I got it working with STLport and all
warnings enabled in VC++ and GCC2.95.2. The patches are here (you can
disregard previously posted patches as they are included below):
------
Only in c:/prj/manhattan/inc/alien/boost/detail/: all.txt
Only in c:/prj/manhattan/inc/alien/boost/detail/: call_traits.hpp
Only in c:/prj/manhattan/inc/alien/boost/detail/: compressed_pair.hpp
diff -c c:/temp/regex/boost/detail/fileiter.hpp
c:/prj/manhattan/inc/alien/boost/detail/fileiter.hpp
*** c:/temp/regex/boost/detail/fileiter.hpp Mon Aug 7 11:09:12 2000
--- c:/prj/manhattan/inc/alien/boost/detail/fileiter.hpp Wed Sep 13 18:07:02
2000
***************
*** 332,338 ****
#endif
};
! inline bool operator < (const file_iterator& f1, const file_iterator& f2)
{
return false;
}
--- 332,339 ----
#endif
};
! // dwa 9/13/00 - suppress unused parameter warning
! inline bool operator < (const file_iterator&, const file_iterator&)
{
return false;
}
***************
*** 376,382 ****
#endif
};
! inline bool operator < (const directory_iterator& f1, const
directory_iterator& f2)
{
return false;
}
--- 377,384 ----
#endif
};
! // dwa 9/13/00 - suppress unused parameter warning
! inline bool operator < (const directory_iterator&, const
directory_iterator&)
{
return false;
}
diff -c c:/temp/regex/boost/detail/jm_cfg.hpp
c:/prj/manhattan/inc/alien/boost/detail/jm_cfg.hpp
*** c:/temp/regex/boost/detail/jm_cfg.hpp Mon Aug 7 11:09:14 2000
--- c:/prj/manhattan/inc/alien/boost/detail/jm_cfg.hpp Wed Sep 13 15:04:24
2000
***************
*** 726,740 ****
inline void BOOST_RE_CALL jm_destroy(T* t)
{
t->~T();
}
! inline void BOOST_RE_CALL jm_destroy(char* t){}
! inline void BOOST_RE_CALL jm_destroy(short* t){}
! inline void BOOST_RE_CALL jm_destroy(unsigned short* t){}
! inline void BOOST_RE_CALL jm_destroy(int* t){}
! inline void BOOST_RE_CALL jm_destroy(unsigned int* t){}
! inline void BOOST_RE_CALL jm_destroy(long* t){}
! inline void BOOST_RE_CALL jm_destroy(unsigned long* t){}
template <class T>
--- 726,742 ----
inline void BOOST_RE_CALL jm_destroy(T* t)
{
t->~T();
+ (void)t; // suppress incorrect MSVC compiler warning
}
! // dwa 9/13/00 - remove unused argument names to suppress compiler
warnings
! inline void BOOST_RE_CALL jm_destroy(char*){}
! inline void BOOST_RE_CALL jm_destroy(short*){}
! inline void BOOST_RE_CALL jm_destroy(unsigned short*){}
! inline void BOOST_RE_CALL jm_destroy(int*){}
! inline void BOOST_RE_CALL jm_destroy(unsigned int*){}
! inline void BOOST_RE_CALL jm_destroy(long*){}
! inline void BOOST_RE_CALL jm_destroy(unsigned long*){}
template <class T>
Only in c:/prj/manhattan/inc/alien/boost/detail/: ob_call_traits.hpp
Only in c:/prj/manhattan/inc/alien/boost/detail/: ob_compressed_pair.hpp
Only in c:/prj/manhattan/inc/alien/boost/detail/: ob_type_traits.hpp
diff -c c:/temp/regex/boost/detail/re_thrd.hpp
c:/prj/manhattan/inc/alien/boost/detail/re_thrd.hpp
*** c:/temp/regex/boost/detail/re_thrd.hpp Mon Aug 7 11:09:14 2000
--- c:/prj/manhattan/inc/alien/boost/detail/re_thrd.hpp Wed Sep 13 18:01:02
2000
***************
*** 126,132 ****
private:
void BOOST_RE_CALL acquire(bool aq, unsigned unused = INFINITE)
! { if(aq) EnterCriticalSection(&hmutex);
else LeaveCriticalSection(&hmutex);
}
--- 126,134 ----
private:
void BOOST_RE_CALL acquire(bool aq, unsigned unused = INFINITE)
! {
! (void)unused; // dwa 09/13/00 - suppress unused argument warning
! if(aq) EnterCriticalSection(&hmutex);
else LeaveCriticalSection(&hmutex);
}
diff -c c:/temp/regex/boost/detail/regcomp.hpp
c:/prj/manhattan/inc/alien/boost/detail/regcomp.hpp
*** c:/temp/regex/boost/detail/regcomp.hpp Mon Aug 7 11:09:14 2000
--- c:/prj/manhattan/inc/alien/boost/detail/regcomp.hpp Wed Sep 13 18:15:38
2000
***************
*** 914,920 ****
s = (charT)c;
char_set_literal:
unsigned i = 0;
! while(s[i])
{
s[i] = traits_inst.translate(s[i], (_flags & regbase::icase));
++i;
--- 914,924 ----
s = (charT)c;
char_set_literal:
unsigned i = 0;
! // dwa 9/13/00 - the previous code had a bug which was revealed
by the STLport debug mode:
! // it would index off the end of the string. A std::string is not
guaranteed to have an
! // element whose value is '\0', and it is allowed to have such an
element before its end.
! // I don't know how many other places this assumption may be
lurking in the code.
! while(i < s.size())
{
s[i] = traits_inst.translate(s[i], (_flags & regbase::icase));
++i;
***************
*** 1026,1032 ****
dat->cclasses = cclasses;
dat->cequivalents = cequivalents;
dat->isnot = isnot;
! dat->next.i = -1;
return dat;
}
--- 1030,1037 ----
dat->cclasses = cclasses;
dat->cequivalents = cequivalents;
dat->isnot = isnot;
! // dwa 09/13/00 - signed/unsigned mismatch in implicit conversion. Is
this intentional?
! dat->next.i = static_cast<unsigned int>(-1);
return dat;
}
***************
*** 1120,1126 ****
}
dat->type = re_detail::syntax_element_set;
! dat->next.i = -1;
return dat;
}
--- 1125,1132 ----
}
dat->type = re_detail::syntax_element_set;
! // dwa 09/13/00 - signed/unsigned mismatch in implicit conversion. Is
this intentional?
! dat->next.i = static_cast<unsigned int>(-1);
return dat;
}
diff -c c:/temp/regex/boost/detail/regfmt.hpp
c:/prj/manhattan/inc/alien/boost/detail/regfmt.hpp
*** c:/temp/regex/boost/detail/regfmt.hpp Mon Aug 7 11:09:14 2000
--- c:/prj/manhattan/inc/alien/boost/detail/regfmt.hpp Wed Sep 13 18:07:52
2000
***************
*** 62,67 ****
--- 62,70 ----
template <class charT, class traits_type>
void BOOST_RE_CALL re_skip_format(const charT*& fmt, const traits_type&
traits_inst)
{
+ // dwa 9/13/00 - suppress incorrect unused parameter warning for MSVC
+ (void)traits_inst;
+
unsigned int parens = 0;
unsigned int c;
while(*fmt)
diff -c c:/temp/regex/boost/detail/regmatch.hpp
c:/prj/manhattan/inc/alien/boost/detail/regmatch.hpp
*** c:/temp/regex/boost/detail/regmatch.hpp Mon Aug 7 11:09:14 2000
--- c:/prj/manhattan/inc/alien/boost/detail/regmatch.hpp Wed Sep 13 19:22:32
2000
***************
*** 50,55 ****
--- 50,58 ----
typedef typename traits_type::string_type traits_string_type;
const traits_type& traits_inst = e.get_traits();
+ // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is
never
+ // referenced
+ (void)traits_inst;
// try and match a single character, could be a multi-character
// collating element...
***************
*** 291,296 ****
--- 294,302 ----
*restart = first;
iterator base = first;
const traits& traits_inst = e.get_traits();
+ // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is
never
+ // referenced
+ (void)traits_inst;
// prepare m for failure:
/*
***************
*** 574,580 ****
for(k = 0; k <= cur_acc; ++k)
prev_pos.push(start_loop[k]);
prev_pos.push(first);
! prev_record.push(ptr);
for(k = 0; k <= cur_acc; ++k)
prev_acc.push(accumulators[k]);
prev_acc.push(cur_acc);
--- 580,588 ----
for(k = 0; k <= cur_acc; ++k)
prev_pos.push(start_loop[k]);
prev_pos.push(first);
! // dwa 9/13/00 - warning: address requested for `ptr',
which is declared `register'
! const re_syntax_base* const ptr_ = ptr;
! prev_record.push(ptr_);
for(k = 0; k <= cur_acc; ++k)
prev_acc.push(accumulators[k]);
prev_acc.push(cur_acc);
***************
*** 676,682 ****
if(need_push_match)
matches.push(temp_match);
prev_pos.push(first);
! prev_record.push(ptr);
for(k = 0; k <= cur_acc; ++k)
prev_acc.push(accumulators[k]);
// for non-greedy repeats save whether we have a match
already:
--- 684,692 ----
if(need_push_match)
matches.push(temp_match);
prev_pos.push(first);
! // dwa 9/13/00 - warning: address requested for `ptr',
which is declared `register'
! const re_syntax_base* const ptr_ = ptr;
! prev_record.push(ptr_);
for(k = 0; k <= cur_acc; ++k)
prev_acc.push(accumulators[k]);
// for non-greedy repeats save whether we have a match
already:
***************
*** 801,807 ****
for(k = 0; k <= cur_acc; ++k)
prev_pos.push(start_loop[k]);
prev_pos.push(first);
! prev_record.push(ptr);
for(k = 0; k <= cur_acc; ++k)
prev_acc.push(accumulators[k]);
prev_acc.push(cur_acc);
--- 811,819 ----
for(k = 0; k <= cur_acc; ++k)
prev_pos.push(start_loop[k]);
prev_pos.push(first);
! // dwa 9/13/00 - warning: address requested for `ptr',
which is declared `register'
! const re_syntax_base* const ptr_ = ptr;
! prev_record.push(ptr_);
for(k = 0; k <= cur_acc; ++k)
prev_acc.push(accumulators[k]);
prev_acc.push(cur_acc);
***************
*** 1057,1062 ****
--- 1069,1077 ----
I base = first;
bool need_init;
const traits& traits_inst = e.get_traits();
+ // dwa 9/13/00 suppress incorrect MSVC warning - it claims this is
never
+ // referenced
+ (void)traits_inst;
flags |= match_init;
Only in c:/prj/manhattan/inc/alien/boost/detail/: tlib.cfg
Only in c:/prj/manhattan/inc/alien/boost/detail/: type_traits.hpp
-------------
diff -c c:/temp/regex/libs/regex/src/cpp_regex_traits.cpp
c:/prj/manhattan/alien/boost/libs/regex/src/cpp_regex_traits.cpp
*** c:/temp/regex/libs/regex/src/cpp_regex_traits.cpp Mon Aug 7 11:09:08
2000
--- c:/prj/manhattan/alien/boost/libs/regex/src/cpp_regex_traits.cpp Wed Sep
13 18:08:08 2000
***************
*** 282,288 ****
psyntax = pmd->syntax_map;
lower_map = new char[char_set_size];
for(unsigned int i = 0; i < char_set_size; ++i)
! lower_map[i] = i;
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<char>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<char>);
--- 282,290 ----
psyntax = pmd->syntax_map;
lower_map = new char[char_set_size];
for(unsigned int i = 0; i < char_set_size; ++i)
! // dwa 9/13/00 - conversion from 'unsigned int' to 'char', possible
loss of data -- intentional?
! lower_map[i] = static_cast<char>(i);
!
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<char>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<char>);
***************
*** 397,403 ****
pmd = new re_detail::message_data<char>(locale_inst,
regex_message_cat);
psyntax = pmd->syntax_map;
for(unsigned int i = 0; i < char_set_size; ++i)
! lower_map[i] = i;
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<char>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<char>);
--- 399,406 ----
pmd = new re_detail::message_data<char>(locale_inst,
regex_message_cat);
psyntax = pmd->syntax_map;
for(unsigned int i = 0; i < char_set_size; ++i)
! // dwa 9/13/00 - conversion from 'unsigned int' to 'char', possible
loss of data -- intentional?
! lower_map[i] = static_cast<char>(i);
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<char>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<char>);
***************
*** 547,553 ****
for(unsigned int j = 0; j < s.size(); ++j)
{
if((s[j] <= UCHAR_MAX) && (s[j] >= 0))
! syntax_[s[j]] = i;
else
{
m.c = s[j];
--- 550,557 ----
for(unsigned int j = 0; j < s.size(); ++j)
{
if((s[j] <= UCHAR_MAX) && (s[j] >= 0))
! // dwa 9/13/00 - conversion from 'unsigned int' to 'unsigned
char', possible loss of data -- intentional?
! syntax_[s[j]] = static_cast<unsigned char>(i);
else
{
m.c = s[j];
***************
*** 720,726 ****
psyntax = pmd->syntax_;
lower_map = new wchar_t[char_set_size];
for(unsigned int i = 0; i < char_set_size; ++i)
! lower_map[i] = i;
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<wchar_t>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<wchar_t>);
--- 724,731 ----
psyntax = pmd->syntax_;
lower_map = new wchar_t[char_set_size];
for(unsigned int i = 0; i < char_set_size; ++i)
! // dwa 9/13/00 - conversion from 'unsigned int' to 'unsigned char',
possible loss of data -- intentional?
! lower_map[i] = static_cast<unsigned char>(i);
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<wchar_t>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<wchar_t>);
***************
*** 743,749 ****
pmd = new re_detail::message_data<wchar_t>(locale_inst,
std::string(regex_message_cat));
psyntax = pmd->syntax_;
for(unsigned int i = 0; i < char_set_size; ++i)
! lower_map[i] = i;
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<wchar_t>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<wchar_t>);
--- 748,755 ----
pmd = new re_detail::message_data<wchar_t>(locale_inst,
std::string(regex_message_cat));
psyntax = pmd->syntax_;
for(unsigned int i = 0; i < char_set_size; ++i)
! // dwa 9/13/00 - conversion from 'unsigned int' to 'unsigned char',
possible loss of data -- intentional?
! lower_map[i] = static_cast<unsigned char>(i);
pctype = &BOOST_RE_USE_FACET(locale_inst, std::ctype<wchar_t>);
pctype->tolower(&lower_map[0], &lower_map[char_set_size]);
pcollate = &BOOST_RE_USE_FACET(locale_inst, std::collate<wchar_t>);
Only in c:/prj/manhattan/alien/boost/libs/regex/src/: makefile
diff -c c:/temp/regex/libs/regex/src/primary_transform.hpp
c:/prj/manhattan/alien/boost/libs/regex/src/primary_transform.hpp
*** c:/temp/regex/libs/regex/src/primary_transform.hpp Mon Aug 7 11:09:12
2000
--- c:/prj/manhattan/alien/boost/libs/regex/src/primary_transform.hpp Wed
Sep 13 18:09:16 2000
***************
*** 45,50 ****
--- 45,53 ----
template <class traits, class charT>
unsigned find_sort_syntax(const traits* pt, charT* delim)
{
+ // Suppress incorrect warning for MSVC
+ (void)pt;
+
//
// compare 'a' with 'A' to see how similar they are,
// should really use a-accute but we can't portably do that,
***************
*** 66,73 ****
string_type sc;
pt->transform(sc, c);
! int pos = 0;
! while((pos <= sa.size()) && (pos <= sA.size()) && (sa[pos] == sA[pos]))
++pos;
--pos;
if(pos < 0)
{
--- 69,78 ----
string_type sc;
pt->transform(sc, c);
! // dwa 9/13/00 - signed/unsigned mismatch
! std::size_t pos1 = 0;
! while((pos1 <= sa.size()) && (pos1 <= sA.size()) && (sa[pos1] ==
sA[pos1])) ++pos1;
! int pos = pos1;
--pos;
if(pos < 0)
{
***************
*** 89,95 ****
//
if((sa.size() == sA.size()) && (sa.size() == c.size()))
{
! *delim = ++pos;
return sort_fixed;
}
//
--- 94,101 ----
//
if((sa.size() == sA.size()) && (sa.size() == c.size()))
{
! // dwa 9/13/00 conversion from 'int' to 'char', possible loss of
data -- intentional?
! *delim = static_cast<charT>(++pos);
return sort_fixed;
}
//
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk