Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sourceware.cygnus.com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin@sourceware.cygnus.com>
List-Help: <mailto:cygwin-help@sourceware.cygnus.com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner@sourceware.cygnus.com
Delivered-To: mailing list cygwin@sourceware.cygnus.com
Date: Mon, 10 Jan 2000 18:18:05 -0500 (EST)
From: Jamie Guinan <guinan@bluebutton.com>
X-Sender: guinan@gemini.home.net
Reply-To: guinan@bluebutton.com
To: Mumit Khan <khan@NanoTech.Wisc.EDU>
cc: Cygwin Mailing List <cygwin@sourceware.cygnus.com>
Subject: Re: Segfault when call kernel32 function 
In-Reply-To: <Pine.HPP.3.96.1000110165637.22291B-100000@hp2.xraylith.wisc.edu>
Message-ID: <Pine.LNX.4.10.10001101758350.1054-100000@gemini.home.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


On Mon, 10 Jan 2000, Mumit Khan wrote:

> On Mon, 10 Jan 2000, Jamie Guinan wrote:
> 
> > Ah!  Got it working now.  When I first tried your suggestion I 
> > mistakenly used
> > 
> >   static const char mode_str[128] = "9600,N,8,1";
> >          ^^^^^
> > 
> > instead of 
> > 
> >   static char mode_str[128] = "9600,N,8,1";
> 
> Yup, the 'const' pretty much kills the reason for making it a writable
> buffer ;-)
> 
> Glad it worked. Feel free to send a bug report to the OS vendor. I bet
> it's going to be fixes as soon as MSVC starts supporting putting const
> strings in readonly memory (or perhaps that's *why* MSVC doesn't do it
> yet).

I did some searching on microsoft.com, and it looks like MSVC 6 did 
in fact start putting const stuff in read-only memory,

  http://support.microsoft.com/support/kb/articles/Q201/3/72.ASP

But the popular reference for Win32 serial programming where I
first found BuildCommDCB is from 1995, pre-MSVC 6,

  http://msdn.microsoft.com/library/techart/msdn_serial.htm

I emailed them about this potential source of confusion, but I'm 
not holding my breath. :)

-Jamie

================================================================
Jamie Guinan                         Blue Button Solutions, Inc.
guinan@bluebutton.com                  http://www.bluebutton.com
================================================================



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com

