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: Gabriel Dos Reis <dosreis at gmail dot com>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 2 Sep 2009 14:03:03 -0500
- Subject: Re: [PATCH]: Cast in c-pretty-print.c causes warning
- References: <90baa01f0908311113h325a0102pf8ed4cea3bb23381@mail.gmail.com>
- Reply-to: gdr at integrable-solutions dot net
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