[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100302121701.GA19208@basil.fritz.box>
Date: Tue, 2 Mar 2010 13:17:02 +0100
From: Andi Kleen <andi@...stfloor.org>
To: Mikael Pettersson <mikpe@...uu.se>
Cc: Roel Kluin <roel.kluin@...il.com>,
Andi Kleen <andi@...stfloor.org>,
"David S. Miller" <davem@...emloft.net>, penberg@...helsinki.fi,
Brian Gerst <brgerst@...il.com>,
Andrew Morton <akpm@...ux-foundation.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-crypto@...r.kernel.org, Herbert@...dor.apana.org.au
Subject: Re: [PATCH v2] compiler: prevent dead store elimination
> > + do { \
> > + struct __scrub { typeof(*p) c[n]; }; \
>
> The typeof(*p) suggestion doesn't work. It would require p to always be
> a pointer type with an accurate (for memset) sizeof(*p). In general however
> we'll memset some array described by a void*/size_t pair, and typeof in
> that case is useless. The original'struct __scrub { char c[n]; };' was Ok.
I just suggested it because of the original array name of the macro
and without it it would have only worked for char arrays. With the new
naming it's ok I guess.
It could be made to work with macros and builtin_type_match I guess,
but it would be fairly ugly and not worth it.
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists