block-sentinel-attribute.C [plain text]
#include <stddef.h>
void (^e) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1)));
void (^e1) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (1,1, 3)));
int main()
{
void (^b) (int arg, const char * format, ...) __attribute__ ((__sentinel__)) =
^ __attribute__ ((__sentinel__)) (int arg, const char * format, ...) {};
void (^z) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (2))) = ^ __attribute__ ((__sentinel__ (2))) (int arg, const char * format, ...) {};
void (^y) (int arg, const char * format, ...) __attribute__ ((__sentinel__ (5))) = ^ __attribute__ ((__sentinel__ (5))) (int arg, const char * format, ...) {};
b(1, "%s", NULL); b(1, "%s", 0);
z(1, "%s",4 ,1,0);
z(1, "%s", NULL, 1, 0);
y(1, "%s", 1,2,3,4,5,6,7);
y(1, "%s", NULL,3,4,5,6,7);
}