[cfe-dev] bool bitfields

Ted Kremenek kremenek at cs.stanford.edu
Tue Sep 14 09:09:19 PDT 2010


For "boolean" bitfields, we sometimes use "unsigned" and sometimes use "bool", e.g.:

$ grep ': 1;' *
...
Type.h:  bool SubClassData : 1;
...
Type.h:  unsigned NoReturn : 1;
...

I vaguely recall that we switched to using "unsigned" a while back for bitfields that were enums (I believe that enums are being treated as "signed" by Visual C++).  Since these are bools, not enum, what should we be doing here?  It would be nice to be consistent.



More information about the cfe-dev mailing list