On Mon, Jun 11, 2012 at 1:24 PM, Benjamin Kramer
<[email protected]>wrote:
>
> On 11.06.2012, at 22:18, Nico Weber wrote:
>
> > Hi Benjamin,
> >
> > in WebKit this fires on a few instances where the unused data members
> > are used just for their size. For example:
> >
> > // See the function above if you need to update this.
> > class SameSizeAsStylePropertySet : public
> > RefCounted<SameSizeAsStylePropertySet> {
> > unsigned bitfield;
> > void* properties;
> > };
> > COMPILE_ASSERT(sizeof(StylePropertySet) ==
> > sizeof(SameSizeAsStylePropertySet),
> > style_property_set_should_stay_small);
> >
> >
> > What's the recommended way to update code like that so that it doesn't
> > trigger this warning? #pragma clang?
>
> The easiest way to silence the warning is to just make the fields public
> instead of private.
That has really unfortunate ramifications though. An attribute to mark the
field as intentionally unused seems superior...
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits