Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: Marco DOT Pettinella AT marconi DOT com X-Lotus-FromDomain: MCMAIN AT MCEXT To: cygwin AT sourceware DOT cygnus DOT com Message-ID: Date: Thu, 22 Jun 2000 14:56:48 +0200 Subject: Unexpected stack dump using strtok() function Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline Hi everybody. I've just installed Cygwin 1.1.2 (uname -r : 1.1.2(0.21/3/2) ). I'm doing some tests finalized to port a Unix application under Windows NT. I noted that, while using strtok() function, I receive a SIGSEGV which causes a stack dump under NT. The little program I used to understand this behaviour was the following: #include #include #include int main() { static char *string = "MARCO#PETTINELLA"; static char *separator = "#"; char *name; char *surname; name = NULL; surname = NULL; name = strtok (string, separator); if (name == NULL) { fprintf (stderr, "NAME IS NULL!\n"); return -1; } fprintf (stderr, "NAME: %s\n", name); surname = strtok (0, separator); if (surname == NULL) { fprintf (stderr, "SURNAME IS NULL!\n"); return -1; } fprintf (stderr, "SURNAME: %s\n", surname); return 0; } I also compiled this program under SCO Unix and HP UX, and I verified that it runs correctly, as expected. I'm wondering if this SIGSEGV is due to a misconfiguration of my gcc or if it is a bug. Does anybody have experienced a problem like this? My release of gcc is 2.95.2-1. Thanks in advance for your help. Marco -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com