Closed Bug 895582 Opened 6 years ago Closed 5 years ago

Get rid of MOZ_ENUM_TYPE


(Core :: MFBT, defect)

Not set





(Reporter: emk, Assigned: emk)




(1 file)

Are we still supporting gcc 4.4? According to bug 894242 comment #9, it looks like that gcc 4.4 fails in the configure script.
If we don't support gcc 4.4 anymore, we can remove MOZ_ENUM_TYPES macro.
Yes, B2G builds still use gcc 4.4.
Ah, bug 770625 was only for linux b2g desktop builds. I see.
Duplicate of this bug: 952949
Actually gcc 4.4 supports typed enums. (See bug 952785.)
Copying the assignee from the duped bug.
Assignee: nobody → nfroyd
It won't be possible to remove this macro when the typed enum is used as the type of a bit-field for some time, due to a GCC bug.  Even super-recent GCC warns when a typed enum is used as a bit-field type (either gunking up output or causing -Werror compile errors):

[jwalden@find-waldo-now tmp]$ cat t.cpp 
enum E : char { x };

struct S
  E field : 1;

int main()
  S s;
  s.field = x;
  return s.field;
[jwalden@find-waldo-now tmp]$ g++49 -std=c++0x -ofoo t.cpp 
t.cpp:5:13: warning: ‘S::field’ is too small to hold all values of ‘enum E’
   E field : 1;

Better yet, the warning is enabled by default and can't be switched off by -Wno-foo or similar.

I ran into this while working on this rev:

The bit-field case is unusual enough it probably prevents few, if any, MOZ_ENUM_TYPE uses from being converted (and probably shouldn't preclude changes -- just have this as the exceptional case, as in that rev).  I guess other concerns of MOZ_ENUM_TYPE (of the kind encountered in bug 952785 and bug 1058561) are going to be more often pressing.
Summary: Get rid of MOZ_ENUM_TYPES → Get rid of MOZ_ENUM_TYPE
B2G ICS emulator builds no longer fail the tests:
Assignee: nfroyd → VYV03354
Attachment #8550541 - Flags: review?(jwalden+bmo)
Attachment #8550541 - Flags: review?(jwalden+bmo) → review+
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.