[LLVMbugs] [Bug 3075] New: Meaningless warning compiling standard code
bugzilla-daemon at cs.uiuc.edu
bugzilla-daemon at cs.uiuc.edu
Sat Nov 15 23:41:36 PST 2008
http://llvm.org/bugs/show_bug.cgi?id=3075
Summary: Meaningless warning compiling standard code
Product: clang
Version: unspecified
Platform: PC
OS/Version: NetBSD
Status: NEW
Severity: normal
Priority: P2
Component: Semantic Analyzer
AssignedTo: unassignedbugs at nondot.org
ReportedBy: neil at daikokuya.co.uk
CC: llvmbugs at cs.uiuc.edu
#include <stdarg.h>
#include <stdio.h>
void foo (const char *msg, ...)
{
va_list ap;
va_start (ap, msg);
vfprintf (stderr, msg, ap);
va_end (ap);
}
gives:
$ clang /tmp/stdarg.c
/tmp/stdarg.c:8:3: warning: passing 'char const *' discards qualifiers,
expected '__builtin_va_list'
va_start (ap, msg);
^~~~~~~~
1 diagnostic generated.
If it helps, the bit after the headers is preprocessed by clang to
void foo (const char *msg, ...)
{
va_list ap;
__builtin_stdarg_start((ap), (msg));
vfprintf ((&__sF[2]), msg, ap);
__builtin_va_end (ap);
}
--
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