OK. I think it might worth a mention in that document that even the latest
compiler by now may produce wasteful result.

Xidorn

On Tue, Oct 21, 2014 at 2:29 PM, David Major <dma...@mozilla.com> wrote:

> Mixing types will likely produce unexpected and/or wasteful results.
> Examples at
> http://randomascii.wordpress.com/2010/06/06/bit-field-packing-with-visual-c/.
> I believe that is still true in VS2013.
>
> David
>
> ----- Original Message -----
> > From: "Xidorn Quan" <quanxunz...@gmail.com>
> > To: dev-platform@lists.mozilla.org
> > Cc: "David Baron" <dba...@dbaron.org>, s...@mozilla.org,
> blizz...@mozilla.org
> > Sent: Tuesday, October 21, 2014 4:21:21 PM
> > Subject: About the bitfield requirement for portibility
> >
> > Hi,
> >
> > I read the C++ portibility guide [1], in which it is said that all
> > bitfields should have the same type, or some compiler may mishandle the
> > code. Is that still true for the compiler set we currently use? The
> > compiler the doc mentioned is MSVC++8 which I believe we have dropped.
> Can
> > we use different type for bitfields in a class in our new code?
> >
> > I found the document is quiet old. It doesn't seem to be maintained
> > anymore. The last update was in 7 years ago, and there are many rules
> have
> > been broken in our current code. At least many bitfield-related rules.
> > Should we follow the guide there? Or do we have another document for this
> > purpose?
> >
> > [1]:
> https://developer.mozilla.org/en-US/docs/Mozilla/Cpp_portability_guide
> >
> > Regards,
> > Xidorn
> > _______________________________________________
> > dev-platform mailing list
> > dev-platform@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-platform
> >
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to