This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]: Cast in c-pretty-print.c causes warning


2009/9/2 Gabriel Dos Reis <dosreis@gmail.com>:
> On Mon, Aug 31, 2009 at 1:13 PM, Kai Tietz<ktietz70@googlemail.com> wrote:
>> Hi,
>>
>> In general it is bad to use size_t to cast point to scalar, but here
>> in c-pretty-print.c is looks ok, as the scalar is truncated to an
>> unsigned int type here and just the lowest 16-bit are in fact used.
>> So here the patch for it
>
> I'm not sure the 'size_t' trick makes the code clearer. ?In fact, I believe
> we want uintptr_t -- but, in the form that OK with C90 compilers.
>
> -- Gaby
>

Right, by this reason we use in w64 not the gnu stdint.h header. We
define uintptr_t/intptr_t/size_t etc with __extension__ to avoid those
warnings.
I can introduce here an new type __extension__ typedef __SIZE_TYPE__
c90_size_t;, if you prefer.

Cheers,
Kai

-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


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