From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 248C63858021 for ; Tue, 17 Nov 2020 15:15:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 248C63858021 Received: by mail-lj1-x231.google.com with SMTP id y16so24697636ljk.1 for ; Tue, 17 Nov 2020 07:15:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :thread-index:content-language; bh=0AfN+uLk/CKU5I3gVas0R83Dm/vz3l/qF8Yf8T64dw0=; b=lraMWhXG8wHj0Xkdoy8ot4zvBfeeLcjW7BwOsjBhHLnlvbRKgzHooRBk40gLQ9gKWW trCILZveC3/dsrUnw09fHCJa3IOAGNBbtXNcZxjmg+qjTmB35XbxQkiegQ56rKaRnhjU UFsxY6mVz4qb/vlcg/MdfEHRMFCl58zLmcCAY5ZxEs9ph71gvuoIoiftbP95cT1qZEjw phgaEZiuedUNz4qEydVlfTpjrtIu/jli5cDgd1RINPcxzVXuZ5XvJDI5hTZmddX50IxK zgirbYU0fRPpHcWjTp5I1DdbPdjcVKDs2zYqy9JyWe5K0QKnuMM0/DP1AXMi0ckZzwr9 PlDw== X-Gm-Message-State: AOAM530vesVTafogBnGNewRW6eHA5UHZUsZza6oT4pCub6LrnYboA8cA u506oyw6q99yYglhUpD1YJ65acS9b+4= X-Google-Smtp-Source: ABdhPJx1Upp54hdysneeHRI/aFa03KIWzCAJrrqdV5bcCnNuhdKbIe30Hs9bcLMB3eyBOV4svIV/bA== X-Received: by 2002:a05:651c:1195:: with SMTP id w21mr1931391ljo.427.1605626115489; Tue, 17 Nov 2020 07:15:15 -0800 (PST) Received: from JOKK (87-249-176-245.ljusnet.se. [87.249.176.245]) by smtp.gmail.com with ESMTPSA id n9sm3086708ljj.124.2020.11.17.07.15.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 07:15:15 -0800 (PST) From: To: Subject: g++ and c++17 filesystem Date: Tue, 17 Nov 2020 16:15:14 +0100 Message-ID: <000001d6bcf4$736e0300$5a4a0900$@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0001_01D6BCFC.D53418B0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: Ada89GzV2DDZmSbxQTSSuQxYzeyQWg== Content-Language: en-gb X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2020 15:15:20 -0000 This is a multipart message in MIME format. ------=_NextPart_000_0001_01D6BCFC.D53418B0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi folks The filesystem-library as a part of C++17 seems to have some defects and flaws in the cygwin-package and pretty much every lexical- and canonical operation works in mysterious ways (or not at all) Following output with g++cygwin $ uname -a CYGWIN_NT-10.0 JOKK 3.1.7(0.340/5/3) 2020-08-22 17:48 x86_64 Cygwin $ g++ --version g++ (GCC) 10.2.0 Copyright (C) 2020 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++ -std=c++17 main.cpp $ ./a.exe true C:/Temp filesystem error: cannot make canonical path: No such file or directory [C:/Temp] Following output with mingw (that also is a bit strange (note the last "generic" (i.e. posix) output)) $ .\g++.exe --version g++.exe (MinGW.org GCC Build-2) 9.2.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ .\g++.exe -std=c++17 main.cpp $ .\a.exe true C:/Temp C:\Temp Following output with cl (that seems to be the most standard-conformant) C:\>cl /std:c++17 main.cpp Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29112 for x86 Copyright (C) Microsoft Corporation. All rights reserved. main.cpp /out:main.exe main.obj C:\>main.exe true C:/Temp C:/Temp I have failed to find out exactly where the defect are though and I also do have a hard time to see where/how/if there's a gcc/g++/mingw- or libstdc++-fork for the cygwin package where this breaks Does anyone have any ideas about this and know of any patches or (hot)fixes to this ? I haven't tried out all the mingw generic/lexical/canonical functions yet, but maybe they're flawed as well Thanx in advance Best regards, Kristian ------=_NextPart_000_0001_01D6BCFC.D53418B0 Content-Type: text/plain; name="main.cpp" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="main.cpp" #include =0A= #include =0A= #include =0A= =0A= // g++ -std=3Dc++17 main.cpp=0A= =0A= =0A= int main()=0A= {=0A= =0A= try=0A= {=0A= const std::filesystem::path path{"C:\\Temp"};=0A= std::cout << std::boolalpha << std::filesystem::exists(path) << = std::noboolalpha << std::endl;=0A= std::cout << path.generic_u8string() << std::endl;=0A= std::cout << std::filesystem::canonical(path).generic_u8string() = << std::endl;=0A= }=0A= catch(const std::exception& e)=0A= {=0A= std::cerr << e.what() << std::endl;=0A= }=0A= =0A= =0A= return 0;=0A= }=0A= =0A= ------=_NextPart_000_0001_01D6BCFC.D53418B0--