[LLVMbugs] [Bug 13189] New: va_list broken with precompiled headers

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Jun 24 07:59:02 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13189

             Bug #: 13189
           Summary: va_list broken with precompiled headers
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Defining va_list in a precompiled header result in type inconsistency and
compilation error in place trying to use this type.

This is a simple test case to reproduce this issue. I'm using c++ to generate
an error, by trying to compile this code in C mode will produce invalid
warnings too.

Tested with clang svn 159110 on x86_64-apple-darwin11.4.0

----- foo.h ----
#include <stdarg.h>
#include <stdio.h>
----------------

------ foo.cpp ----
int myvprintf(const char *fmt, va_list args) {
    return vprintf(fmt, args);
}
------------------

> clang++ -x c++-header foo.h
> clang++ -include foo.h -fsyntax-only foo.cpp
foo.cpp:3:9: error: no matching function for call to 'vprintf'
        return vprintf(fmt, args);
               ^~~~~~~
/usr/include/stdio.h:283:6: note: candidate function not viable: no known
conversion from '__va_list_tag *' to '__va_list_tag *' for 2nd argument;
int      vprintf(const char * __restrict, va_list)
__DARWIN_LDBL_COMPAT(vprintf) __printflike(1, 0);
         ^
1 error generated.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list