From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68679 invoked by alias); 11 Jun 2018 02:12:07 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 68659 invoked by uid 89); 11 Jun 2018 02:12:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=fstream, HX-HELO:sk:mail-pl, H*r:sk:az12-v6, H*r:sk:mail-pl X-HELO: mail-pl0-f49.google.com Received: from mail-pl0-f49.google.com (HELO mail-pl0-f49.google.com) (209.85.160.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Jun 2018 02:12:05 +0000 Received: by mail-pl0-f49.google.com with SMTP id az12-v6so11399854plb.8 for ; Sun, 10 Jun 2018 19:12:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:newsgroups:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6k5J6PDEUOAyE6X5z60yxeJgx/s8pzBp40HwQCun9Bc=; b=DB/KMX0m+AoB5EYmOcYPino9ekGYuGeNrMLUAZpw+pPUPPS1g8vPFXmhdcrPAa/Cfp MXVuoXSJrMr678iw0uPYacgvZsUgv3ineR+SEi9VjZw6SPO1K4dmzm70y+kSfP4tjGWe OR9Kib/a0KbQyMf15VGf4oO1DI0lwaLRL47clLUjV24BEtfB2ksfv1ClmOJbtVAbOraU qIDAUP3maio2BrKtmD98OE70JeO9X4pdrBnY9axvTxPjQj/Jjlut91UAvONmw0JmbwnO IqN2gK+1rf56YQlQnQnQQ0Lq1q02PoyPQ1v4/y6qBIi3LbsUdPF/wafC9M+W1kd0HAiT 3ZZA== X-Gm-Message-State: APt69E0AfHIV/SP9BOMv0zB6nFc/4LxmVHRObjoEfxMqQ836EeJQ+275 0z8mZv01GZk9xm9N406c3gaPjY4= X-Google-Smtp-Source: ADUXVKIaz3NTDN8qtNZvZq6eYf0QCsl3kgJbQWk7EV6AMIkF3i0wVDwqawfAWW+pI8IWhjVNfJVwyA== X-Received: by 2002:a17:902:9a4b:: with SMTP id x11-v6mr16368105plv.176.1528683123623; Sun, 10 Jun 2018 19:12:03 -0700 (PDT) Received: from [10.0.0.87] (125-236-198-58.adsl.xtra.co.nz. [125.236.198.58]) by smtp.gmail.com with ESMTPSA id p12-v6sm21851097pfi.175.2018.06.10.19.12.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jun 2018 19:12:02 -0700 (PDT) Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream To: cygwin@cygwin.com Newsgroups: gmane.os.cygwin References: From: Ross Smith Message-ID: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> Date: Mon, 11 Jun 2018 02:12:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2018-06/txt/msg00113.txt.bz2 On 2018-06-06 09:00, Marco Atzeri wrote: > On 6/5/2018 10:32 PM, Ivan Shynkarenka wrote: >>   Hello >> >> I use x64 bit Cygwin and it failed in my home, work and Appveyor.  I add >> cygcheck.out with my environment. >> >> I'm sorry about misspell prefix space in my prev example. Please try the >> following one: >> >> #include >> #include >> >> int main(int argc, char** argv) >> { >>      std::string line; >>      std::ifstream stream("test.cpp"); >>      while (getline(stream, line)) >>          std::cout << line << std::endl; >>      return 0; >> } >> >> g++ -std=gnu++17 test.cpp > > works fine on 32 bit and 64 bit on my W7 I'm having the same problem. My test program: #include #include int main() { std::ifstream in("demo.cpp"); std::string line; for (;;) { std::getline(in, line); if (! in && line.empty()) break; std::cout << line << "\n"; } } $ g++ demo.cpp -std=c++17 -o demo && ./demo Aborted (core dumped) It's crashing on the call to std::getline(). It only happens in -std=gnu++17 mode (or the equivalent gnu++1z, or c++17/1z). If I compile with -std=gnu++14 or lower it works. I'm using 64-bit Cygwin, everything updated to the current release, on Windows 8.1. Ross Smith -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69309 invoked by alias); 11 Jun 2018 02:12:12 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 69006 invoked by uid 89); 11 Jun 2018 02:12:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*r:Unknown, HContent-Transfer-Encoding:8bit X-HELO: blaine.gmane.org Received: from Unknown (HELO blaine.gmane.org) (195.159.176.226) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Jun 2018 02:12:08 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fSCHK-0006Rs-2q for cygwin@cygwin.com; Mon, 11 Jun 2018 04:09:54 +0200 To: cygwin@cygwin.com From: Ross Smith Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream Date: Mon, 11 Jun 2018 13:08:00 -0000 Message-ID: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 In-Reply-To: X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00114.txt.bz2 Message-ID: <20180611130800.tJI0emb4fE1vZQwRiR1HTZH4MmkJqQ6qNNpCq3rArb4@z> On 2018-06-06 09:00, Marco Atzeri wrote: > On 6/5/2018 10:32 PM, Ivan Shynkarenka wrote: >>   Hello >> >> I use x64 bit Cygwin and it failed in my home, work and Appveyor.  I add >> cygcheck.out with my environment. >> >> I'm sorry about misspell prefix space in my prev example. Please try the >> following one: >> >> #include >> #include >> >> int main(int argc, char** argv) >> { >>      std::string line; >>      std::ifstream stream("test.cpp"); >>      while (getline(stream, line)) >>          std::cout << line << std::endl; >>      return 0; >> } >> >> g++ -std=gnu++17 test.cpp > > works fine on 32 bit and 64 bit on my W7 I'm having the same problem. My test program: #include #include int main() { std::ifstream in("demo.cpp"); std::string line; for (;;) { std::getline(in, line); if (! in && line.empty()) break; std::cout << line << "\n"; } } $ g++ demo.cpp -std=c++17 -o demo && ./demo Aborted (core dumped) It's crashing on the call to std::getline(). It only happens in -std=gnu++17 mode (or the equivalent gnu++1z, or c++17/1z). If I compile with -std=gnu++14 or lower it works. I'm using 64-bit Cygwin, everything updated to the current release, on Windows 8.1. Ross Smith -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple