add missing attributes to the remaining calls, even the ones that gcc has

builtin attributes for (for symmetry and consistency). In the future this
might change to use compiler-neutral macros. On the other hand I don't
know of any other compiler that provides other macros with similar
functionality, so why bother?
This commit is contained in:
christos 2008-09-21 16:59:46 +00:00
parent ccc14bc16a
commit 9fa41d7348
3 changed files with 35 additions and 24 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: monetary.h,v 1.1 2005/04/03 20:09:29 christos Exp $ */ /* $NetBSD: monetary.h,v 1.2 2008/09/21 16:59:46 christos Exp $ */
/*- /*-
* Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org> * Copyright (c) 2001 Alexey Zelkin <phantom@FreeBSD.org>
@ -45,7 +45,8 @@ typedef _BSD_SSIZE_T_ ssize_t;
#endif #endif
__BEGIN_DECLS __BEGIN_DECLS
ssize_t strfmon(char * __restrict, size_t, const char * __restrict, ...); ssize_t strfmon(char * __restrict, size_t, const char * __restrict, ...)
__attribute__((__format__(__strfmon__, 3, 4)));
__END_DECLS __END_DECLS
#endif /* !_MONETARY_H_ */ #endif /* !_MONETARY_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: stdio.h,v 1.72 2008/08/04 17:08:49 matt Exp $ */ /* $NetBSD: stdio.h,v 1.73 2008/09/21 16:59:46 christos Exp $ */
/*- /*-
* Copyright (c) 1990, 1993 * Copyright (c) 1990, 1993
@ -221,13 +221,15 @@ int fgetc(FILE *);
int fgetpos(FILE * __restrict, fpos_t * __restrict); int fgetpos(FILE * __restrict, fpos_t * __restrict);
char *fgets(char * __restrict, int, FILE * __restrict); char *fgets(char * __restrict, int, FILE * __restrict);
FILE *fopen(const char * __restrict , const char * __restrict); FILE *fopen(const char * __restrict , const char * __restrict);
int fprintf(FILE * __restrict , const char * __restrict, ...); int fprintf(FILE * __restrict , const char * __restrict, ...)
__attribute__((__format__(__printf__, 2, 3)));
int fputc(int, FILE *); int fputc(int, FILE *);
int fputs(const char * __restrict, FILE * __restrict); int fputs(const char * __restrict, FILE * __restrict);
size_t fread(void * __restrict, size_t, size_t, FILE * __restrict); size_t fread(void * __restrict, size_t, size_t, FILE * __restrict);
FILE *freopen(const char * __restrict, const char * __restrict, FILE *freopen(const char * __restrict, const char * __restrict,
FILE * __restrict); FILE * __restrict);
int fscanf(FILE * __restrict, const char * __restrict, ...); int fscanf(FILE * __restrict, const char * __restrict, ...)
__attribute__((__format__(__scanf__, 2, 3)));
int fseek(FILE *, long, int); int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *); int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *); long ftell(FILE *);
@ -235,27 +237,34 @@ size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *); int getc(FILE *);
int getchar(void); int getchar(void);
void perror(const char *); void perror(const char *);
int printf(const char * __restrict, ...); int printf(const char * __restrict, ...)
__attribute__((__format__(__printf__, 1, 2)));
int putc(int, FILE *); int putc(int, FILE *);
int putchar(int); int putchar(int);
int puts(const char *); int puts(const char *);
int remove(const char *); int remove(const char *);
void rewind(FILE *); void rewind(FILE *);
int scanf(const char * __restrict, ...); int scanf(const char * __restrict, ...)
__attribute__((__format__(__scanf__, 1, 2)));
void setbuf(FILE * __restrict, char * __restrict); void setbuf(FILE * __restrict, char * __restrict);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t); int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
int sscanf(const char * __restrict, const char * __restrict, ...); int sscanf(const char * __restrict, const char * __restrict, ...)
__attribute__((__format__(__scanf__, 2, 3)));
FILE *tmpfile(void); FILE *tmpfile(void);
int ungetc(int, FILE *); int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict, _BSD_VA_LIST_); int vfprintf(FILE * __restrict, const char * __restrict, _BSD_VA_LIST_)
int vprintf(const char * __restrict, _BSD_VA_LIST_); __attribute__((__format__(__printf__, 2, 0)));
int vprintf(const char * __restrict, _BSD_VA_LIST_)
__attribute__((__format__(__printf__, 1, 0)));
#ifndef __AUDIT__ #ifndef __AUDIT__
char *gets(char *); char *gets(char *);
int sprintf(char * __restrict, const char * __restrict, ...); int sprintf(char * __restrict, const char * __restrict, ...)
__attribute__((__format__(__printf__, 2, 3)));
char *tmpnam(char *); char *tmpnam(char *);
int vsprintf(char * __restrict, const char * __restrict, int vsprintf(char * __restrict, const char * __restrict,
_BSD_VA_LIST_); _BSD_VA_LIST_)
__attribute__((__format__(__printf__, 2, 0)));
#endif #endif
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE)

View File

@ -1,4 +1,4 @@
/* $NetBSD: time.h,v 1.36 2008/04/01 19:23:28 drochner Exp $ */ /* $NetBSD: time.h,v 1.37 2008/09/21 16:59:46 christos Exp $ */
/* /*
* Copyright (c) 1989, 1993 * Copyright (c) 1989, 1993
@ -95,7 +95,8 @@ struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *); struct tm *localtime(const time_t *);
time_t mktime(struct tm *); time_t mktime(struct tm *);
size_t strftime(char * __restrict, size_t, const char * __restrict, size_t strftime(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict); const struct tm * __restrict)
__attribute__((__format__(__strftime__, 3, 0)));
time_t time(time_t *); time_t time(time_t *);
#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \