From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122172 invoked by alias); 11 Jun 2018 20:38:34 -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 122076 invoked by uid 89); 11 Jun 2018 20:38:33 -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 20:38:32 +0000 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fSTY1-0007In-Sv for cygwin@cygwin.com; Mon, 11 Jun 2018 22:36:17 +0200 To: cygwin@cygwin.com From: Ross Smith Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream Date: Tue, 12 Jun 2018 08:48:00 -0000 Message-ID: References: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> <1e9791c0-fbc9-6507-58bc-6864ae65c967@gmail.com> 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: <1e9791c0-fbc9-6507-58bc-6864ae65c967@gmail.com> X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00118.txt.bz2 Message-ID: <20180612084800.NUDQUR4U3-kyy4PQl1qYUrMrP3v6xcpugWrKCgLzL-8@z> On 2018-06-12 02:17, Marco Atzeri wrote: > On 6/11/2018 4:11 AM, Ross Smith wrote: >> 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"); > > > with this change does not segfault > >   std::ifstream stream("demo.cpp\n"); It doesn't segfault because it doesn't open the file, because no file named "demo.cpp\n" exists. I don't know WTF you thought you were doing here. 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