[Filesystem] path refuses "foo\bar" on win32/mingw

When passing "foo\bar" to boost::filesystem::path constructor, it is accepted when compiled with MSVC, but is refused when compiled with mingw-gcc (v3.4.2). "foo/bar" argument is accepted with both compilers. Test-case: #include <boost/filesystem/path.hpp> #include <iostream> using namespace boost::filesystem; using namespace std; int main(int argc, char *argv[]) { path::default_name_check(native); try { path p1("foo/bar"); cerr << "ok - constructed from 'foo/bar'" << endl; } catch (std::exception &e) { cerr << e.what() << endl; } try { path p1("foo\\bar"); cerr << "ok - constructed from 'foo\\bar'" << endl; } catch (std::exception &e) { cerr << e.what() << endl; } return 0; } Compiled with: g++ -I c:\boostcvs\include\boost-1_33 -L c:\boostcvs\lib test-path.cpp -o test-path -lboost_filesystem-mgw-d Tested against: Boost 1.32 release, CVS HEAD Is it a bug in FS library, or I'm doing something wrong? One would expect native paths be accepted by path with native namechecker, and I can't see any mingw/msvc-specific code in FS library, which could explain why it works with one compiler, but not with other compiler... Alo

On 7/18/05, Alo Sarv <alo.sarv@gmail.com> wrote:
Compiled with: g++ -I c:\boostcvs\include\boost-1_33 -L c:\boostcvs\lib test-path.cpp -o test-path -lboost_filesystem-mgw-d Tested against: Boost 1.32 release, CVS HEAD
After some more searching, I found that it's actually dll builds that break on mingw - static builds work fine - all dll tests on file_system library seem to be skipped on mingw as well ... why? Alo

"Alo Sarv" <alo.sarv@gmail.com> wrote in message news:14a0620d05071816267c719bfc@mail.gmail.com...
On 7/18/05, Alo Sarv <alo.sarv@gmail.com> wrote:
Compiled with: g++ -I c:\boostcvs\include\boost-1_33 -L c:\boostcvs\lib test-path.cpp -o test-path -lboost_filesystem-mgw-d Tested against: Boost 1.32 release, CVS HEAD
After some more searching, I found that it's actually dll builds that break on mingw - static builds work fine - all dll tests on file_system library seem to be skipped on mingw as well ... why?
It looks as if mingw ::GetLastError() is returning 0 rather than the correct error code under some conditions. Furthermore, some versions of gcc fail to deal with function address comparisons correctly across dll boundaries. I'm not sure which bug has bitten you. At least that is the appearance. I haven't had time to verify the bug or determine the exact conditions and versions involved, so if you want to track the problem down and file a bug report, that would be helpful. Thanks, --Beman
participants (1)
-
Alo Sarv
-
Beman Dawes