attr-bounded.c 517 B

123456789101112131415
  1. // RUN: %clang_cc1 -fsyntax-only %s
  2. // Make sure OpenBSD's bounded extension is accepted.
  3. typedef long ssize_t;
  4. typedef unsigned long size_t;
  5. typedef struct FILE FILE;
  6. ssize_t read(int, void *, size_t)
  7. __attribute__((__bounded__(__buffer__,2,3)));
  8. int readlink(const char *, char *, size_t)
  9. __attribute__((__bounded__(__string__,2,3)));
  10. size_t fread(void *, size_t, size_t, FILE *)
  11. __attribute__((__bounded__(__size__,1,3,2)));
  12. char *getwd(char *)
  13. __attribute__((__bounded__(__minbytes__,1,1024)));