It does seem slightly over-pedantic of the warning to complain about this, though. I'll take a look at it.
- Hans On Tue, Jul 31, 2012 at 8:42 AM, Chandler Carruth <[email protected]> wrote: > I can find nothing in any spec which would shed light on what the correct > behavior is for the warning, but it seems unlikely to be important to give > fprintf a pointer to a volatile int as opposed to a normal int.... > > > On Tue, Jul 31, 2012 at 12:27 AM, Alexey Samsonov <[email protected]> > wrote: >> >> Hello Hans, >> >> After this patch one of our tests failed with the following error: >> >> error: format specifies type 'int *' but the argument has type 'volatile >> int *' [-Werror,-Wformat] >> fprintf(stdout, "printing a string: %s%n\n", s, &a); >> ~~ ^~ >> >> Do you think that we should fix the code, or Clang shouldn't produce the >> warning in this case? >> >> On Mon, Jul 30, 2012 at 9:11 PM, Hans Wennborg <[email protected]> wrote: >>> >>> Author: hans >>> Date: Mon Jul 30 12:11:32 2012 >>> New Revision: 160966 >>> >>> URL: http://llvm.org/viewvc/llvm-project?rev=160966&view=rev >>> Log: >>> Make -Wformat check the argument type for %n. >>> >>> This makes Clang check that the corresponding argument for "%n" in a >>> format string is a pointer to int. _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
