int main () { if (foo1 (0x13) != 8) abort(); if (foo2 (0x06) != 27) abort(); if (foo3 (0x02) != 4) abort(); if (foo4 (0x01) != 7) abort(); if (foo5 (0x15) != 65) abort(); if (foo6 (0x103) != 8) abort(); if (foo7 (0x04) != 21) abort(); if (foo8 (0x07) != 72) abort(); if (foo9 (0x10000011L) != 0) abort(); if (foo10 (0x1000105L) != 0) abort(); if (foo11 (0x1000008L) != 39) abort(); if (foo12 (0x1000004L) != 0) abort(); if (foo13 (0x109LL) != 0) abort(); if (foo14 (0x108LL) != 39) abort(); if (foo15 (0x1000001LL) != 7) abort(); if (foo16 (0x100000004LL) != 21) abort(); return 0; }
int main () { foo1(1, NULL); // OK foo1(1, 0) ; // expected-warning {{missing sentinel in function call}} foo5(1, NULL, 2); // OK foo5(1,2,NULL, 1); // OK foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}} foo6(1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}} foo6(1,NULL,3,4,5,6,7); // OK foo7(1); // expected-warning {{not enough variable arguments in 'foo7' declaration to fit a sentinel}} foo7(1, NULL); // OK foo12(1); // expected-warning {{not enough variable arguments in 'foo12' declaration to fit a sentinel}} }
void test1() { foo1(1, NULL); // OK foo1(1, 0) ; // expected-warning {{missing sentinel in function call}} foo5(1, NULL, 2); // OK foo5(1,2,NULL, 1); // OK foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}} foo6(1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}} foo6(1,NULL,3,4,5,6,7); // OK foo7(1); // expected-warning {{not enough variable arguments in 'foo7' declaration to fit a sentinel}} foo7(1, NULL); // OK foo12(1); // expected-warning {{not enough variable arguments in 'foo12' declaration to fit a sentinel}} // PR 5685 struct A {}; struct A a, b, c; foo1(3, &a, &b, &c); // expected-warning {{missing sentinel in function call}} foo1(3, &a, &b, &c, (struct A*) 0); }