From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121543 invoked by alias); 11 Jun 2018 20:38:29 -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 121533 invoked by uid 89); 11 Jun 2018 20:38:29 -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=HX-Received:sk:61-v6mr, HX-HELO:sk:mail-pl, H*r:sk:mail-pl, HContent-Transfer-Encoding:8bit X-HELO: mail-pl0-f44.google.com Received: from mail-pl0-f44.google.com (HELO mail-pl0-f44.google.com) (209.85.160.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 11 Jun 2018 20:38:27 +0000 Received: by mail-pl0-f44.google.com with SMTP id w17-v6so12992096pll.9 for ; Mon, 11 Jun 2018 13:38:27 -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=t0B/WZ1B0zAsH7dwqEy2wuU06N5kbj1sgkTCSeyJjGE=; b=FUemu6z9lL6K/vPxd0gsUidek3pKAffCRCJyR9OYpIwLZEmaGlnSkzBYikK9VR6SAZ QBGwARFHak/COJkc0b59M+WlYxw2A6ChkocyAJO2Px6a5KSTnKnvyxuF1ux4AzckHqdT q3XYT68L07ZVSayzn5MTFgVXBO1vBSDIlqueXfGuIi6cKCWjl7F2evPLdblS3AyaT5lr yUaVL8yqy4qejRpCf6tUhqtO95hfG5dh3FSxPf2ZpJS9qrywSLjzf0Wkns9PpTBo2ACw XTasAau4W/JYvgjhcr4TX24fj5bcn3dazuqOCfYQdKC5KBT+SWKNgJ7QL4ntYflLSB4W gLxw== X-Gm-Message-State: APt69E2qX6yqoORc4B8KxnQlsae1Slw362/eE+cnuB5kZsWa8jK9ZiWH /vMA9m9zDRRvPI0iI00tfCCXv+s= X-Google-Smtp-Source: ADUXVKJZDxGfZwHKIggE/mQfZMf+YiF6CKDvArCZDXXOfPxBAXplG9kN/rWj/db0aGxPsjAjObYHrA== X-Received: by 2002:a17:902:43:: with SMTP id 61-v6mr731624pla.112.1528749506191; Mon, 11 Jun 2018 13:38:26 -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 y17-v6sm38107897pfe.33.2018.06.11.13.38.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jun 2018 13:38:25 -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: <0d0d9dc4-5cce-724a-6fb2-7bf0a5a71db4@otoy.com> <1e9791c0-fbc9-6507-58bc-6864ae65c967@gmail.com> From: Ross Smith Message-ID: Date: Tue, 12 Jun 2018 02:01: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: <1e9791c0-fbc9-6507-58bc-6864ae65c967@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2018-06/txt/msg00117.txt.bz2 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 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