X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Message-ID: <494C12B1.4040504@cygwin.com> Date: Fri, 19 Dec 2008 16:31:29 -0500 From: "Larry Hall (Cygwin)" Reply-To: cygwin AT cygwin DOT com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.18) Gecko/20081120 Remi/2.0.0.18-1.fc8.remi Lightning/0.9 Thunderbird/2.0.0.18 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: printf goes to serial port? References: <494BE168 DOT 1020600 AT rettc DOT com> <494C01A8 DOT 8040200 AT rettc DOT com> <494C0B68 DOT 1040207 AT rettc DOT com> In-Reply-To: <494C0B68.1040207@rettc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Note-from-DJ: This may be spam Alex Martin wrote: > > > Gary R. Van Sickle wrote: >> A few gaps that need filling before anything better than SWAGs can >> come your >> way: >> - Is this app a Cygwin app, > > No, it is a windows app. > > I am using cygwin primarily because I get the /dev/ttyS* devices. If you're using /dev/ttyS*, then you're using cygwin1.dll. That makes it a Cygwin app. You're not going to get POSIX/Linux support from a vanilla Win32 environment. I feel obliged to mention that because of you're using the Cygwin DLL, whatever you're working on needs to comply with the Cygwin licensing scheme if you're distributing it in any way. > or is Cygwin involved only perhiperally (e.g. >> you're using Cygwin make to run the MinGW toolchain), > > No mingw. Using all of cygwin's make, g++, etc. > > or is Cygwin not >> directly involved at all and you're saying "My non-Cygwin-related app was >> working fine, I changed a bunch of stuff in the app and also upgraded >> Cygwin, and now the app is broke and I'm thinking Cygwin could be to >> blame"? > > I do not think the app is broken. Somehow stdout is going to the serial > port, my code relating to file descriptors (a serialio class that > provides functions like open, close, read, write, flush), opening and > closing the devices, etc has never changed (that is, the code is the > same code since back when printf worked). Other code has changed, that > is, the gui layout, function flow, etc. Given the description so far, this is starting to sound like a case of mixed CRTs, Cygwin's and MS's. Only one can be in charge of stdin/stdout/ stderr if you expect to get sane results. And calls to CRT I/O functions have to occur entirely in one or the other to see consistent results. >> - Since your app is a GUI app, where did you expect your printf()s to go? > > Well, someone taught me to use cygwin in this manner, and I have been > doing so for a long time, that is, I can use a cygwin window to invoke > my windows app, and the cygwin console would catch printfs (stdout > chatter), so you can use it as a debug console. That's not guaranteed. It really sounds to me like you just want a way to look at some messages when they are triggered. You'd be better off with something like "OutputDebugString()" and DebugView if the application isn't a console app. And even if it is, this could go a long way towards unraveling any mixing and matching that you may have inadvertently done with I/O and CRTs. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 893-9889 - FAX Holliston, MA 01746 _____________________________________________________________________ A: Yes. > Q: Are you sure? >> A: Because it reverses the logical flow of conversation. >>> Q: Why is top posting annoying in email? -- 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/