gcc/testsuite/g++.dg/warn/sentinel.C
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-Wall" } */ |
| 3 | extern void ex (int i, ...) __attribute__ ((__sentinel__(0))); |
| 4 | |
| 5 | void f() |
| 6 | { |
| 7 | ex (1, 0); /* { dg-warning "missing sentinel in function call" } */ |
| 8 | ex (1, 0L); /* { dg-warning "missing sentinel in function call" } */ |
| 9 | ex (1, (void *)0); |
| 10 | ex (1, __null); /* { dg-bogus "sentinel" } */ |
| 11 | } |