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


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


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