Closed Bug 1202965 Opened 9 years ago Closed 9 years ago

Add MOZ_UNUSED

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(2 files)

mozilla::unused is nice but can't be used in (a) C code, and (b) C++ code where linking with unused.o is tricky. Therefore a fallback macro MOZ_UNUSED will be useful. I already have several places where it will be useful.
Attached patch (part 1) - Add MOZ_UNUSED (deleted) — Splinter Review
Attachment #8658508 - Flags: review?(nfroyd)
Attachment #8658509 - Flags: review?(mh+mozilla)
Attachment #8658509 - Flags: review?(mh+mozilla) → review+
With all the back and forth on that file, we might as well have fixed it to use write's return value.
Comment on attachment 8658508 [details] [diff] [review] (part 1) - Add MOZ_UNUSED Review of attachment 8658508 [details] [diff] [review]: ----------------------------------------------------------------- ::: mfbt/unused.h @@ +34,5 @@ > +#endif // __cplusplus > + > +// An alternative to mozilla::unused for use in (a) C code and (b) code where > +// linking with unused.o is difficult. > +#define MOZ_UNUSED(expr) \ I almost want to hide this thusly: #ifdef MOZ_MOZILLA_UNUSED_DOESNT_WORK_HERE #define MOZ_UNUSED(expr) ... #undef MOZ_MOZILLA_UNUSED_DOESNT_WORK_HERE #endif (only half joking here).
Attachment #8658508 - Flags: review?(nfroyd) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: