OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [warn/] [format1.C] - Blame information for rev 154

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
// Test that formats get checked according to C94.
2
// Origin: Joseph Myers .
3
// { dg-do compile }
4
// { dg-options "-ansi -pedantic -Wformat" }
5
 
6
#include 
7
 
8
void
9
foo (int i, int *ip, __WINT_TYPE__ lc, wchar_t *ls)
10
{
11
  std::printf ("%d%ls%lc\n", i, ls, lc);
12
  std::printf ("%d", ls); // { dg-warning "format" "printf warning" }
13
  std::scanf ("%d%lc%ls%l[abc]", ip, ls, ls, ls);
14
  std::scanf ("%hd", ip); // { dg-warning "format" "scanf warning" }
15
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.