[llvm-bugs] [Bug 33370] New: include/__bsd_locale_fallbacks.h uses varargs but doesn't include <stdarg.h>

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jun 8 16:55:58 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=33370

            Bug ID: 33370
           Summary: include/__bsd_locale_fallbacks.h uses varargs but
                    doesn't include <stdarg.h>
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: michaeljclark at mac.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

Created attachment 18600
  --> https://bugs.llvm.org/attachment.cgi?id=18600&action=edit
Patch to add #include <stdarg.h> to __bsd_locale_fallbacks.h

I get the following errors when compiling libcxx against musl libc headers:

In file included from third_party/libcxx/src/algorithm.cpp:11:
In file included from third_party/libcxx/include/random:1646:
In file included from third_party/libcxx/include/istream:163:
In file included from third_party/libcxx/include/ostream:140:
In file included from third_party/libcxx/include/locale:220:
third_party/libcxx/include/__bsd_locale_fallbacks.h:106:5: error: use of
undeclared
      identifier 'va_start'
    va_start(__va, __format);

__bsd_locale_fallbacks.h has an include <stdlib.h> but is missing <stdarg.h>
which is where varargs are defined (it may be masked on platforms that include
stdarg.h by default in stdlib.h)

The following patch fixes the issue:

--- a/include/__bsd_locale_fallbacks.h
+++ b/include/__bsd_locale_fallbacks.h
@@ -15,6 +15,7 @@
 #define _LIBCPP_BSD_LOCALE_FALLBACKS_DEFAULTS_H

 #include <stdlib.h>
+#include <stdarg.h>
 #include <memory>

 _LIBCPP_BEGIN_NAMESPACE_STD

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170608/62c070bf/attachment.html>


More information about the llvm-bugs mailing list