X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Lewis Hyatt Subject: Re: can't read sequential files Date: Thu, 01 Nov 2007 18:24:32 -0400 Lines: 25 Message-ID: References: <13500536 DOT post AT talk DOT nabble DOT com> <13524102 DOT post AT talk DOT nabble DOT com> <005c01c81c79$d7545d30$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <008501c81c9f$ffd4c0d0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <009101c81ca5$95db06c0$2e08a8c0 AT CAM DOT ARTIMI DOT COM> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: <009101c81ca5$95db06c0$2e08a8c0@CAM.ARTIMI.COM> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com > Hang on, I misread you, my eye skipped over the bit where you suggest that > adding the check somehow makes the preceding fopen call succeed instead of > fail. However I still don't think that's what the OP was saying, unless the > subject line of this thread is terribly wrong, I think you just read a bit too > much into OP's phrase "everything worked"; I think that just means "program > ran to completion /without/ a segfault". It was more than that: >and then rebuilding the code, everything worked. But it's strange that >if I delete that code segment and never check whether the fp pointer is >NULL or not, I always get a segmentation fault. Can this be some kind >of an optimization problem? I don't know why it happens. Thank you for >the comments. Especially when he suggested it was a problem with the compiler optimizer, I am pretty sure that he means the code is working as expected with this check in there, and he doesn't understand why. (The subject line applies from back before he tried this.) But anyway you could be right too, I guess there's no point in guessing what he meant... -Lewis -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/