On Feb 16, 2012, at 1:57 AM, Jean-Daniel Dupas <[email protected]> wrote:

> Hi,
> 
> This patch implements a long standing FIXME.
> When calling a non variadic format function(vprintf, vscanf, NSLogv, …), is 
> the format argument references a parameter of the enclosing function, clang 
> never warned.
> With this change, clang will inhibit the warning only if the parameter is 
> declared as a format string with a compatible type.
> 
> 
> -- Jean-Daniel
> 

Hi Jean-Daniel,

I've noticed this patch contains seemingly unrelated changes, e.g.:


>  // RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral -pedantic %s
>  
> +#include <stdarg.h>
> +
>  extern "C" {
> -extern int scanf(const char *restrict, ...);
> -extern int printf(const char *restrict, ...);
> +extern int scanf(const char *, ...);
> +extern int printf(const char *, ...);
> +extern int vprintf(const char *, va_list ap);
>  }
>  


What is the motivation for removing the 'restrict' in these test cases?  It 
seems completely unrelated, unnecessary, and actually incorrect since clang 
defaults to c99.

Ted


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to