[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-sparse
Subject:    Re: [RFC] evaluate: pointer arithmetics on plain void* (was: [PATCH] evaluate: reject post-ops on vo
From:       Christopher Li <sparse () chrisli ! org>
Date:       2012-01-24 10:54:45
Message-ID: CANeU7Q=jtJ=cVcgKdidA_8Fds3qVX980M_-Q0OkiiOvvo-MRBA () mail ! gmail ! com
[Download RAW message or body]

On Mon, Jan 23, 2012 at 2:32 AM, Jan Pokorný <pokorny_jan@seznam.cz> wrote:
> Hm, I was talking about post-ops only, the example showed a failing pre-op
> ...both is a single case as evaluate_preop boils down to evaluate_postop.
>
> I went through evaluate.c again and I think these cases should be somehow
> unified (stating current state):

I am leaning towards make the explicit sizeof(void) as error.
Implicate sizeof(void) used in the pointer arithmetic are (optional) warnings.
The question is we give warning or not. Hmm.

However, forcing the type cast to get rid of the warning is very ugly.
"(void*)(++(char*)a)" is harder to read than "++a".

It is too late tonight for me to look at the patch right now. I will
take a closer look
tomorrow.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic