Browse Source

Use attribute((sentinel)) on functions where it makes sense.

(this will warn if they are used without a terminating NULL pointer.
Note *pointer*, very useful for arches where 0 != (void *)0, in size)
okay millert@
OPENBSD_3_2
espie 22 years ago
parent
commit
d02a02b867
2 changed files with 13 additions and 7 deletions
  1. +6
    -3
      src/include/bsd_auth.h
  2. +7
    -4
      src/include/unistd.h

+ 6
- 3
src/include/bsd_auth.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: bsd_auth.h,v 1.5 2002/03/12 02:28:11 millert Exp $ */
/* $OpenBSD: bsd_auth.h,v 1.6 2002/06/05 19:27:50 espie Exp $ */
/*-
* Copyright (c) 1997 Berkeley Software Design, Inc. All rights reserved.
@ -58,7 +58,9 @@ char *auth_getitem(auth_session_t *, auth_item_t);
int auth_setitem(auth_session_t *, auth_item_t, char *);
auth_session_t *auth_open(void);
auth_session_t *auth_verify(auth_session_t *, char *, char *, ...);
auth_session_t *auth_verify(auth_session_t *, char *, char *, ...)
__attribute__((sentinel));
auth_session_t *auth_userchallenge(char *, char *, char *, char **);
auth_session_t *auth_usercheck(char *, char *, char *, char *);
@ -76,7 +78,8 @@ void auth_setenv(auth_session_t *);
void auth_clrenv(auth_session_t *);
void auth_setstate(auth_session_t *, int);
int auth_call(auth_session_t *, char *, ...);
int auth_call(auth_session_t *, char *, ...)
__attribute__((sentinel));
int auth_setdata(auth_session_t *, void *, size_t);
int auth_setoption(auth_session_t *, char *, char *);


+ 7
- 4
src/include/unistd.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: unistd.h,v 1.37 2002/02/17 19:42:21 millert Exp $ */
/* $OpenBSD: unistd.h,v 1.38 2002/06/05 19:27:50 espie Exp $ */
/* $NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $ */
/*-
@ -66,9 +66,12 @@ size_t confstr(int, char *, size_t);
char *cuserid(char *);
int dup(int);
int dup2(int, int);
int execl(const char *, const char *, ...);
int execle(const char *, const char *, ...);
int execlp(const char *, const char *, ...);
int execl(const char *, const char *, ...)
__attribute__((sentinel));
int execle(const char *, const char *, ...)
__attribute__((sentinel));
int execlp(const char *, const char *, ...)
__attribute__((sentinel));
int execv(const char *, char * const *);
int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);


Loading…
Cancel
Save