Closed Bug 895582 Opened 11 years ago Closed 9 years ago

Get rid of MOZ_ENUM_TYPE

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: emk, Assigned: emk)

References

Details

Attachments

(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.
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:

https://hg.mozilla.org/integration/mozilla-inbound/rev/37314ece19fa

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:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=417bb36e0bcb
https://treeherder.mozilla.org/#/jobs?repo=try&revision=92e97ca9f43d
Assignee: nfroyd → VYV03354
Status: NEW → ASSIGNED
Attachment #8550541 - Flags: review?(jwalden+bmo)
Attachment #8550541 - Flags: review?(jwalden+bmo) → review+
https://hg.mozilla.org/mozilla-central/rev/e22b313075cc
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.