Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Message-ID: <41F4E1EA.8030505@familiehaase.de> Date: Mon, 24 Jan 2005 12:54:18 +0100 From: "Gerrit P. Haase" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910 MIME-Version: 1.0 To: peter AT wyrmberg DOT co DOT uk CC: cygwin AT cygwin DOT com Subject: Re: TEXT mode, BINARY mode default file opening References: <1106555053 DOT 11795 DOT 26 DOT camel AT localhost DOT localdomain> In-Reply-To: <1106555053.11795.26.camel@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Pete James wrote: > Hello, > > I am new to the list a have only been using CYGWIN for a few months. > > I would like to use the GNU compiler as a cross compiler for a Windoze > machine and I am having problems with the files being opened in BINARY > mode, I think. > > I have the whole system running on Windoze 2000 using an old version of > CYGWIN circa version 1.5.5, it all works perfectly but when I try and > install it on a Windoze XP machine it CYGWIN falls over with a heap > allocation error. So, looking at the FAQ etc I learn that I need the new > version of CYGWIN. > > I install the latest version of CYGWIN on my Windoze XP machine and I > have no heap problems but what I get now is 'Invalid token in > expression' errors from the compiler on lines of code that wrap past the > carriage return. I understand that this is due to the way in which MSDOS > and UNIX text files are stored. Anyway looking at the FAQ etc, I find > that there is an environmental variable CYGWIN which if I make > =nobinmode it will not open the files in BINARY. Well sure enough if I > run CYGWIN and type mount all my mounts are in TEXT mode. But the > compiler still doesn't work. Looking deeper, I find that the latest > versions of CYGWIN default to BINARY and older ones TEXT mode. This I > think explains it. But how do I get the compiler to open the files in > TEXT mode. > > This is what I think is happening. The compiler is being activated from > JAVA application which is creating an MSDOS shell. When the compiler is > called, the CYGWIN DLL loads, when this happens will the CYGWIN > environment variable be used? I also have found information that says is > the path called is explicit with a drive letter for example, then the > opening mode will be BINARY. Can this be changed to TEXT? > > Unfortunately I can't change all the files to remove the extra carriage > returns or line feeds as the files are used by other programs. So I > think my options are: > > 1. Try and find a way of CYGWIN to open the files correctly (if indeed > it is caused by CYGWIN, note I don't say problem with CYGWIN) > 2. Try and find an intermediate version of CYGWIN, I think 1.5.9 has the > XP heap fixed but not the default mount mode changed. > 3. Recompile the compiler with --no-cygwin, will this allow it to work > in Windozes without CYGWIN? > 4. Recompile the compiler with a windows compiler so as to make it a > native windoze application. > > Well, thanks for reading all that, I hope some of you out there have > some good thoughts, and ideas for me to try. I never have any problems with any files, regardless which mode these files are. GCC doesn't care if you use \r\n or \n as line ending. What are extra carriage returns? You have \r\n or you have \n, what else could be there? Your options: 1. Binary mode opens a file as is and if that doesn't work your files are broken? 2. No older version of Cygwin is supported. 3. MinGW GCC is what you'e looking for. 4. MinGW GCC is what you'e looking for. Gerrit -- =^..^= -- 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/