[PATCH] D56023: [libcxx] Mark do_open, do_get and do_close parameters unused when catopen is missing
Petr Hosek via Phabricator
reviews at reviews.llvm.org
Fri Dec 21 14:07:21 PST 2018
phosek created this revision.
phosek added reviewers: ldionne, EricWF, mclow.lists.
Herald added subscribers: libcxx-commits, christof.
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.
Repository:
rCXX libc++
https://reviews.llvm.org/D56023
Files:
libcxx/include/locale
Index: libcxx/include/locale
===================================================================
--- libcxx/include/locale
+++ libcxx/include/locale
@@ -3560,7 +3560,11 @@
template <class _CharT>
typename messages<_CharT>::catalog
+#ifdef _LIBCPP_HAS_CATOPEN
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
+#else // !_LIBCPP_HAS_CATOPEN
+messages<_CharT>::do_open(const basic_string<char>&, const locale&) const
+#endif // _LIBCPP_HAS_CATOPEN
{
#ifdef _LIBCPP_HAS_CATOPEN
catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
@@ -3574,8 +3578,12 @@
template <class _CharT>
typename messages<_CharT>::string_type
+#ifdef _LIBCPP_HAS_CATOPEN
messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
const string_type& __dflt) const
+#else // !_LIBCPP_HAS_CATOPEN
+messages<_CharT>::do_get(catalog, int, int, const string_type& __dflt) const
+#endif // _LIBCPP_HAS_CATOPEN
{
#ifdef _LIBCPP_HAS_CATOPEN
string __ndflt;
@@ -3597,7 +3605,11 @@
template <class _CharT>
void
+#ifdef _LIBCPP_HAS_CATOPEN
messages<_CharT>::do_close(catalog __c) const
+#else // !_LIBCPP_HAS_CATOPEN
+messages<_CharT>::do_close(catalog) const
+#endif // _LIBCPP_HAS_CATOPEN
{
#ifdef _LIBCPP_HAS_CATOPEN
if (__c != -1)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56023.179351.patch
Type: text/x-patch
Size: 1298 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181221/a61074b4/attachment-0001.bin>
More information about the libcxx-commits
mailing list