From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 18573 invoked from network); 27 Mar 1998 19:47:38 -0000 Received: from ellpspace.math.ualberta.ca (michal@129.128.88.19) by mail2.redhat.com with SMTP; 27 Mar 1998 19:47:38 -0000 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.5/8.8.5) id MAA07554 for axp-list@redhat.com; Fri, 27 Mar 1998 12:47:49 -0700 From: Michal Jaegermann Message-Id: <199803271947.MAA07554@ellpspace.math.ualberta.ca> Subject: Re: POSIX, alpha, strtok() and char *'s... To: axp-list@redhat.com Date: Fri, 27 Mar 1998 12:47:49 -0700 (MST) In-Reply-To: from "s.c. trusty" at Mar 27, 98 10:33:33 am Content-Type: text > > > my question regards POSIX saying that strtok returns a char *. > > on my axp, sizeof(char *) = 8 > > sizeof(strtok(configToken, \",\")) is 4 (!) Are you sure that you included a header file and that compiling with -Wall does not come up with any warnings? Undeclared types default in C to int (sizeof(int) is four on Alpha). Your result is typical for a buggy coding which trips so many on Alpha > hence, sizeof((char *)strtok(configToken, ",")) = cast to pointer from > integer of different > size for reasons you state so clearly. You can get away with something like that on Intel. I cannot check it right now but I have a strong suspicion that your C is not correct. Or you found a true bug in headers. Michal