[cfe-commits] r158317 - in /cfe/trunk: include/clang/Basic/DiagnosticGroups.td test/FixIt/fixit.cpp

Chandler Carruth chandlerc at google.com
Mon Jun 11 13:27:58 PDT 2012


On Mon, Jun 11, 2012 at 1:24 PM, Benjamin Kramer
<benny.kra at googlemail.com>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...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120611/a4736868/attachment.html>


More information about the cfe-commits mailing list