Skip to content

Meaningless warning compiling standard code #3447

@llvmbot

Description

@llvmbot
Bugzilla Link 3075
Resolution FIXED
Resolved on Mar 12, 2010 00:57
Version unspecified
OS NetBSD
Reporter LLVM Bugzilla Contributor

Extended Description

#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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions