This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: silence warning in spu/stat.c


Jeff Johnston wrote:
> jschopp wrote:
>> Ben Elliston wrote:
>>>> Forgive my ignorance, but why is pathname an unsigned int in the
>>>> stat structure and not declared a pointer of some kind?
>>>
>>> This is a good question.  I don't know why it was done this way.  Joel?
>>>
>>> Ben
>>>
>>
>> I'm guessing here, but...
>>
>> unsigned int is the same size on ppc32, ppc64, and spu.  This is not
>> true of a pointer type like char* .  By using a definition that is the
>> same on all 3 the structure definition can be identical everywhere it
>> might be used.
> 
> Is the pathname address on the ppc64 guaranteed to fit within the
> unsigned int? (i.e. never clipped).

The pathname is an address of SPU's local store, not of main memory.
So it is always 32bit length in C/C++ regardless of type of
corresponding PPU process.

-- 
(ASAYAMA Kazunori
  (asayama@sm.sony.co.jp))
t


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