comp.lang.c
[Top] [All Lists]

Re: void * vs. T *

Subject: Re: void * vs. T *
From: CBFalconer
Date: Fri, 28 Mar 2008 11:35:40 -0500
Newsgroups: comp.lang.c

Keith Thompson wrote:
> CBFalconer <cbfalconer@xxxxxxxxx> writes:
>> lawrence.jones@xxxxxxxxxxx wrote:
>>> santosh <santosh.k83@xxxxxxxxx> wrote:
>>>>
>>>> I know of no platforms where different pointer types are
>>>> different, let alone perversions worthy of the DS9k.
>>>
>>> Crays (and other word-addressed machines) have a different
>>> representation for char * and void * than other pointers due to
>>> the need to keep an offset within the word in addition to the
>>> address of the word.
>>
>> Are you sure of that?
> 
> He probably is.  I know I am, since I've worked on such machines.
> 
>>             That is contrary to the C standard.
> 
> No it isn't.  char*, unsigned char*, signed char*, and void* are
> required to have the same representation as each other (perhaps
> that's what caused your confusion), but they're not required to
> have the same representation, or even the same size, as other
> pointer types.

Read the quote again.  He is referring specifically to void* and
char*.  Not to any other type of pointer.  At least as I read it,
on rereading I can see a misunderstanding possibility.

-- 
 [mail]: Chuck F (cbfalconer at maineline dot net) 
 [page]: <http://cbfalconer.home.att.net>
            Try the download section.



-- 
Posted via a free Usenet account from http://www.teranews.com


<Prev in Thread] Current Thread [Next in Thread>