lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] building LMI with newer boost


From: Greg Chicares
Subject: Re: [lmi] building LMI with newer boost
Date: Wed, 31 Dec 2008 10:56:42 +0000
User-agent: Thunderbird 2.0.0.18 (Windows/20081105)

On 2008-12-31 03:08Z, Greg Chicares wrote:
> On 2008-12-30 23:01Z, Vadim Zeitlin wrote:
[...]
>> OTOH has_leaf() is only used in 2 places right now (And
>> leaf() in a couple of more) so maybe inserting 2 #ifs right where it's used
>> is not too bad?

See below....

> [...] First, of course, I'll want to consider
> why I'm using those functions at all, in case there's really
> no good reason.

Grepping for 'has_leaf', one use seems suspicious, but my
suspicion falls on the boost library, not the way I use it:

/// Preconditions: census input filepath is nonempty and has a leaf.
/// It's not apparent how a nonempty path could fail to have a leaf,
/// but presumably boost has some undocumented reason.
...
    LMI_ASSERT(!exemplar.empty());
    LMI_ASSERT(exemplar.has_leaf());

yet perhaps you can show me something I'm missing.

But the other use seems essential:

    return path.has_leaf() ? path.leaf() : std::string("Hastur");

>> I realize that
>> it probably isn't particularly useful to LMI right now but sooner or later
>> you will start using a more recent Boost version and it might be nice to
>> not have this problem then.
> 
> Yes. We're going to have to do it eventually, and I've got
> time now, so why wait?

Well...it turns out they've deprecated quite a lot:

http://www.boost.org/doc/libs/1_37_0/libs/filesystem/doc/index.htm#Deprecated-names

so there are more than two places we'd have to change:

data_directory.cpp:    LMI_ASSERT(a_filename == path.leaf());
ihs_proddata.cpp:    LMI_ASSERT(a_Filename == path.leaf());
ledger_xsl.cpp:    fs::path real_filepath(orthodox_filename(filepath.leaf()));
path_utility.cpp:    return fs::change_extension(exemplar.leaf(), s);
test_coding_rules.cpp:    ,leaf_name_(path_.leaf())
view_ex.cpp:    return path.has_leaf() ? path.leaf() : std::string("Hastur");
argv0.hpp:        p = boost::filesystem::system_complete(z).branch_path();
path_utility.cpp:        filepath = filepath.branch_path() / basename;
file_command_wx.cpp:                (path.native_file_string()
file_command_wx.cpp:                (path.native_file_string()
file_command_wx.cpp:            << path.native_file_string()
file_command_wx.cpp:            << path.native_file_string()
argv0_test.cpp:    fs::path::default_name_check(fs::native);
global_settings.cpp:/// default_name_check() will throw an exception, so 
there's no need
global_settings_test.cpp:        (fs::path::default_name_check(fs::native)
path_utility.cpp:    fs::path::default_name_check(fs::native);

and it's not a simple matter of renaming a couple of functions,
either, because some of these features have been removed.

So, if you just want to address the has_leaf() problem for now:

http://lists.nongnu.org/archive/html/lmi/2008-12/msg00024.html
| It was apparently a mistake and corrected
| since then (see https://svn.boost.org/trac/boost/changeset/48374/)

then I'd ask whether you could just apply the boost patch cited
to correct that boost mistake. OTOH, if you want to address the
whole problem, so that lmi builds with the latest version of
boost with BOOST_FILESYSTEM_NO_DEPRECATED defined, then you're
welcome to, but that's a much bigger undertaking than I have
time for.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]