> On Jan 29, 2021, at 11:37 , Gedare Bloom <ged...@rtems.org> wrote:
> 
> On Fri, Jan 29, 2021 at 9:03 AM Sebastian Huber 
> <sebastian.hu...@embedded-brains.de> wrote:
> On 29/01/2021 16:09, Joel Sherrill wrote:
> 
> > On Fri, Jan 29, 2021 at 9:06 AM Gedare Bloom <ged...@rtems.org
> > <mailto:ged...@rtems.org>> wrote:
> >
> >
> >
> >     On Fri, Jan 29, 2021 at 12:24 AM Sebastian Huber
> >     <sebastian.hu...@embedded-brains.de
> >     <mailto:sebastian.hu...@embedded-brains.de>> wrote:
> >
> >         Do not use an enum as a bit field.  Document the state flags.
> >
> >
> > Is this a new style rule that needs to be documented?
> 
> Into which category would you put this? Language and Compiler?
> 
> https://docs.rtems.org/branches/master/eng/coding-conventions.html
> 
> 
> Yes.
> 
> 
I use enums as bit fields a lot. I use them in conjunction with objects that 
are the same enum.

I avoid using #define.  In most situations you can't print them in a debugger 
and they imply restricted usage.

Is this an appropriate warning?  Does it always mean that the enum should be 
replaced with a #define?

If it doesn't always apply then the style should make it clear when it should 
apply.

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering

This email is delivered through the public internet using protocols subject to 
interception and tampering.

Attachment: signature.asc
Description: Message signed with OpenPGP

_______________________________________________
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel

Reply via email to