This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Segfault when call kernel32 function


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).

Regards,
Mumit



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]