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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ext/] [attrib4.C] - Rev 699

Compare with Previous | Blame | View Log

// { dg-do assemble  }
// { dg-options "-Wformat" }
// Test that attributes are really applied to function declarations under
// various conditions.
// Contributed by Jason Merrill (jason@cygnus.com)

#define PF __attribute__ ((format (printf, 1, 2)))

struct A {
  static PF void f (const char *, ...);
  static PF void g (const char *, ...) { }
  static void test ();
};

void PF h (const char *, ...);
void PF k (const char *, ...) { }

void A::test ()
{
  f ("%f", 42);                 // { dg-warning "argument 2" }
  g ("%f", 42);                 // { dg-warning "argument 2" }
  h ("%f", 42);                 // { dg-warning "argument 2" }
  k ("%f", 42);                 // { dg-warning "argument 2" }
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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