Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Re: POSIX, alpha, strtok() and char *'s...
Date: Fri, 27 Mar 1998 12:47:49 -0700 (MST)	[thread overview]
Message-ID: <199803271947.MAA07554@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <Pine.LNX.3.96.980327103219.5105A-100000@omega.croesus.net> from "s.c. trusty" at Mar 27, 98 10:33:33 am

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


      parent reply	other threads:[~1998-03-27 19:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-03-27 17:33 POSIX, alpha, strtok() and char *'s s.c. trusty
1998-03-27 18:42 ` Uncle George
1998-03-27 19:47 ` Michal Jaegermann [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox