pointer-subtract-compat.c 303 B

1234567891011
  1. // RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic
  2. typedef const char rchar;
  3. int a(char* a, rchar* b) {
  4. return a-b;
  5. }
  6. // <rdar://problem/6520707>
  7. void f0(void (*fp)(void)) {
  8. int x = fp - fp; // expected-warning{{arithmetic on pointers to the function type 'void (void)' is a GNU extension}}
  9. }