diff options
author | Petr Hosek <phosek@chromium.org> | 2019-01-13 22:15:37 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-01-13 22:15:37 +0000 |
commit | b7ce40f73b895ff6c2489297c4c9752605cee99d (patch) | |
tree | 82b99e75890a7b1655fa5ff9c0615d090d8f567d /libcxx | |
parent | 42a432d4d3d67a75afe87e61b30ad149da7a0083 (diff) |
[libcxx] Mark do_open, do_get and do_close parameters unused when catopen is missing
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/error when building with -Wunused-parameter.
Differential Revision: https://reviews.llvm.org/D56023
Diffstat (limited to 'libcxx')
-rw-r--r-- | libcxx/include/__config | 2 | ||||
-rw-r--r-- | libcxx/include/locale | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config index 72838764265..e82d7fec566 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -1424,6 +1424,8 @@ _LIBCPP_FUNC_VIS extern "C" void __sanitizer_annotate_contiguous_container( # endif // defined(_LIBCPP_ABI_MICROSOFT) && !defined(_LIBCPP_BUILDING_LIBRARY) #endif // _LIBCPP_NO_AUTO_LINK +#define _LIBCPP_UNUSED_VAR(x) ((void)(x)) + #endif // __cplusplus #endif // _LIBCPP_CONFIG diff --git a/libcxx/include/locale b/libcxx/include/locale index ac589d36043..2043892fa2d 100644 --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -3568,6 +3568,7 @@ messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const __cat = static_cast<catalog>((static_cast<size_t>(__cat) >> 1)); return __cat; #else // !_LIBCPP_HAS_CATOPEN + _LIBCPP_UNUSED_VAR(__nm); return -1; #endif // _LIBCPP_HAS_CATOPEN } @@ -3591,6 +3592,9 @@ messages<_CharT>::do_get(catalog __c, int __set, int __msgid, __n, __n + strlen(__n)); return __w; #else // !_LIBCPP_HAS_CATOPEN + _LIBCPP_UNUSED_VAR(__c); + _LIBCPP_UNUSED_VAR(__set); + _LIBCPP_UNUSED_VAR(__msgid); return __dflt; #endif // _LIBCPP_HAS_CATOPEN } @@ -3604,6 +3608,8 @@ messages<_CharT>::do_close(catalog __c) const __c <<= 1; nl_catd __cat = (nl_catd)__c; catclose(__cat); +#else // !_LIBCPP_HAS_CATOPEN + _LIBCPP_UNUSED_VAR(__c); #endif // _LIBCPP_HAS_CATOPEN } |