When catopen is missing, do_open, do_get and do_close end up being
no-op, and as such their parameters will be unused which triggers a
warning when building with -Wunused-parameter.
Details
Details
- Reviewers
ldionne EricWF mclow.lists - Commits
- rG2fefe153dd93: [libcxx] Mark do_open, do_get and do_close parameters unused when catopen is…
rCXX351027: [libcxx] Mark do_open, do_get and do_close parameters unused when catopen is…
rL351027: [libcxx] Mark do_open, do_get and do_close parameters unused when catopen is…
Diff Detail
Diff Detail
- Repository
- rCXX libc++
Event Timeline
libcxx/include/locale | ||
---|---|---|
3564 | Looking at this, I frowned. It seems like a lot of text just to remove a parameter name. I went looking in the rest of libc++, and I found places in <unordered_map> where we say ((void)__p) and in <stdexcept> where we say ((void)__msg) rather than conditionally remove the parameter name. This makes me think that a _LIBCPP_UNUSED_VAR macro might be useful; it would make it clear what we're trying to accomplish: #define _LIBCPP_UNUSED_VAR(x) ((void)(x)) |
Comment Actions
I like this much better now; making a note to myself to go back to <unordered_map> and <stdexcept> and use this there.
Looking at this, I frowned. It seems like a lot of text just to remove a parameter name.
I went looking in the rest of libc++, and I found places in <unordered_map> where we say ((void)__p) and in <stdexcept> where we say ((void)__msg) rather than conditionally remove the parameter name.
This makes me think that a _LIBCPP_UNUSED_VAR macro might be useful; it would make it clear what we're trying to accomplish: #define _LIBCPP_UNUSED_VAR(x) ((void)(x))