This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Implement ISO/IEC TS 18822 C++ File system TS


On 01/05/15 11:53 +0100, Jonathan Wakely wrote:
On 01/05/15 10:05 +0900, Luke Allardyce wrote:
This fails on mingw-w64 4.02 due to

Yay, thanks for trying it!

an extra typename:

/mnt/build/native/gcc/x86_64-w64-mingw32/libstdc++-v3/include/experimental/fs_path.h:784:35:
error: expected nested-name-specifier
     using _CharAlloc = typename __alloc_rebind<_Allocator, char>;

Oops, forgetting how to use my own alias.


readdir_r not available:

/mnt/src/gcc/libstdc++-v3/src/filesystem/dir.cc:169:46: error:
'readdir_r' was not declared in this scope
 if (int err = readdir_r(dirp, &ent, &result))


and calling opendir with a wchar_t*

/mnt/src/gcc/libstdc++-v3/src/filesystem/dir.cc:108:40: error: cannot
convert 'const value_type* {aka const wchar_t*}' to 'const char*' for
argument '1' to 'DIR* opendir(const char*)'
   if (DIR* dirp = ::opendir(p.c_str()))

/mnt/src/gcc/libstdc++-v3/src/filesystem/dir.cc:256:38: error: cannot
convert 'const value_type* {aka const wchar_t*}' to 'const char*' for
argument '1' to 'DIR* opendir(const char*)'
 if (DIR* dirp = ::opendir(p.c_str()))

Ah interesting, this means mingw supports <dirent.h>, I was expecting
it to use the dummy definitions at the top of src/filesystem/dir.cc
(where I'd made opendir take wchar_t).

I've done some reading and am going to commit some fixes and
improvements for mingw in an hour or two. It would be great if you
could try it again after that.

I've committed the two changes attached (only tested on linux again).

patch2.txt should fix the mingw-w64 errors above, as well as the
issues Daniel reported, and should fix the error on Solaris 10

Rainer, would you be able to test with
--enable-libstdcxx-filesystem-ts before we re-enable it to build by
default on solaris* ?


patch1.txt changes path::_M_cmpts from std::list to std::vector (as
Marc suggested months ago) and fixes the pretty printer, so paths are
shown like this in GDB:

(gdb) print p
$1 = filesystem::path ""
(gdb) print c
$2 = filesystem::path "/home/jwakely" = {[root-directory] = "/", [1] = "home", [2] = "jwakely"}
(gdb) print r
$3 = filesystem::path "/" [root-directory]
(gdb) print h
$4 = filesystem::path "home"
(gdb) print l
$5 = filesystem::path "//host/foo/bar///baz/.//xyzzy/meta/syntactic/variable" = {[root-name] = "//host", [root-directory] = "/", [2] = "foo", [3] = "bar", [4] = "baz", [5] = ".", [6] = "xyzzy", [7] = "meta", [8] = "syntactic", [9] = "variable"}

That output came from debugging this code:

 path p;
 path c = current_path();
 path r = *c.begin();
 path h = *std::next(c.begin());
 path l = "//host/foo/bar///baz/.//xyzzy/meta/syntactic/variable";


Thanks everyone for testing and feedback, it's been very helpful.

Attachment: patch1.txt
Description: Text document

Attachment: patch2.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]