This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Cast in c-pretty-print.c causes warning
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: gdr at integrable-solutions dot net
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 2 Sep 2009 21:50:27 +0200
- Subject: Re: [PATCH]: Cast in c-pretty-print.c causes warning
- References: <90baa01f0908311113h325a0102pf8ed4cea3bb23381@mail.gmail.com> <206fcf960909021203na444027xd9f6efc3522a1879@mail.gmail.com>
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