mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-04 06:01:23 -05:00
Introduce and use LDAP_GCCATTR() = __attributes__() in gcc
This commit is contained in:
parent
dc6754c781
commit
33cc7d4cf1
15 changed files with 28 additions and 22 deletions
|
|
@ -121,7 +121,7 @@ static void add_to(char ***list, int *nlist, char **new);
|
|||
static int isgroup(LDAPMessage *e);
|
||||
static void add_error(Error **err, int *nerr, int code, char *addr, LDAPMessage *msg);
|
||||
static void add_group(char *dn, Group **list, int *nlist);
|
||||
static void unbind_and_exit(int rc);
|
||||
static void unbind_and_exit(int rc) LDAP_GCCATTR((noreturn));
|
||||
static int group_loop(char *dn);
|
||||
static void send_group(Group *group, int ngroup);
|
||||
static int has_attributes(LDAPMessage *e, char *attr1, char *attr2);
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ char *templatefile = TEMPLATEFILE;
|
|||
char myhost[MAXHOSTNAMELEN];
|
||||
int myport;
|
||||
|
||||
static void usage ( char *name );
|
||||
static void usage ( char *name ) LDAP_GCCATTR((noreturn));
|
||||
static int set_socket (int port);
|
||||
static RETSIGTYPE wait4child(int sig);
|
||||
static void do_queries (int s);
|
||||
static void do_queries (int s) LDAP_GCCATTR((noreturn));
|
||||
static void do_error (FILE *fp, char *s);
|
||||
static void do_search (LDAP *ld, FILE *fp, char *buf);
|
||||
static void do_read (LDAP *ld, FILE *fp, char *dn);
|
||||
|
|
|
|||
|
|
@ -63,10 +63,10 @@ char *templatefile = TEMPLATEFILE;
|
|||
char *friendlyfile = FRIENDLYFILE;
|
||||
int rdncount = GO500GW_RDNCOUNT;
|
||||
|
||||
static void usage ( char *name );
|
||||
static void usage ( char *name ) LDAP_GCCATTR((noreturn));
|
||||
static int set_socket (int port);
|
||||
static RETSIGTYPE wait4child(int sig);
|
||||
static void do_queries (int s);
|
||||
static void do_queries (int s) LDAP_GCCATTR((noreturn));
|
||||
static char *pick_oc ( char **oclist );
|
||||
static int isnonleaf ( LDAP *ld, char **oclist, char *dn );
|
||||
static void do_menu (LDAP *ld, FILE *fp, char *dn);
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ static void add_to( char ***list, int *nlist, char **new );
|
|||
static void add_single_to( char ***list, char *new );
|
||||
static int isgroup( LDAPMessage *e );
|
||||
static void add_error( Error **err, int *nerr, int code, char *addr, LDAPMessage *msg );
|
||||
static void unbind_and_exit( int rc );
|
||||
static void unbind_and_exit( int rc ) LDAP_GCCATTR((noreturn));
|
||||
static void send_group( Group *group, int ngroup );
|
||||
|
||||
static int connect_to_x500( void );
|
||||
|
|
@ -1829,7 +1829,3 @@ unbind_and_exit( int rc )
|
|||
|
||||
exit( rc );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ static LDAP *ld;
|
|||
#define T_NEWSUPSTR "newsuperior"
|
||||
|
||||
|
||||
static void usage LDAP_P(( const char *prog ));
|
||||
static void usage LDAP_P(( const char *prog )) LDAP_GCCATTR((noreturn));
|
||||
static int process_ldapmod_rec LDAP_P(( char *rbuf ));
|
||||
static int process_ldif_rec LDAP_P(( char *rbuf, int count ));
|
||||
static void addmodifyop LDAP_P(( LDAPMod ***pmodsp, int modop, char *attr,
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ void print_help LDAP_P(( char *s ));
|
|||
#ifdef DEBUG
|
||||
#endif
|
||||
|
||||
void do_commands LDAP_P(( void ));
|
||||
void do_commands LDAP_P(( void )) LDAP_GCCATTR((noreturn));
|
||||
void status LDAP_P(( void ));
|
||||
void change_base LDAP_P(( int type, char **base, char *s ));
|
||||
void initialize_client LDAP_P(( void ));
|
||||
|
|
@ -280,7 +280,7 @@ void ka_StringToKey LDAP_P(( char *str, char *cell, des_cblock *key ));
|
|||
/* in util.c: */
|
||||
void printbase LDAP_P(( char *lead, char *s ));
|
||||
void fetch_buffer LDAP_P(( char *buffer, int length, FILE *where ));
|
||||
void fatal LDAP_P(( char *s ));
|
||||
void fatal LDAP_P(( char *s )) LDAP_GCCATTR((noreturn));
|
||||
int isgroup LDAP_P(( void ));
|
||||
void format LDAP_P(( char *str, int width, int lead ));
|
||||
void format2 LDAP_P(( char *s, char *ft, char *t, int fi, int i, int w ));
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@
|
|||
# include <libutil.h>
|
||||
#else
|
||||
/* use lutil version */
|
||||
LDAP_F(void) (setproctitle) LDAP_P((const char *fmt, ...));
|
||||
LDAP_F(void) (setproctitle) LDAP_P((const char *fmt, ...)) \
|
||||
LDAP_GCCATTR((format(printf, 1, 2)));
|
||||
LDAP_F(int) Argc;
|
||||
LDAP_F(char) **Argv;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ ber_pvt_log_printf LDAP_P((
|
|||
int errlvl,
|
||||
int loglvl,
|
||||
const char *fmt,
|
||||
... ));
|
||||
... )) LDAP_GCCATTR((format(printf, 3, 4)));
|
||||
|
||||
LDAP_END_DECL
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,13 @@
|
|||
# define LDAP_F_EXPORT extern
|
||||
#endif
|
||||
|
||||
#if (__GNUC__) * 1000 + (__GNUC_MINOR__) >= 2006
|
||||
# define LDAP_GCCATTR(attrs) __attribute__(attrs)
|
||||
#else
|
||||
# define LDAP_GCCATTR(attrs)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _LDAP_CDEFS_H */
|
||||
|
||||
/* purposely allow these to be redefined */
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ extern int ldap_syslog_level;
|
|||
|
||||
LDAP_F(void) lutil_debug LDAP_P((
|
||||
int debug, int level,
|
||||
const char* fmt, ... ));
|
||||
const char* fmt, ... )) LDAP_GCCATTR((format(printf, 3, 4)));
|
||||
|
||||
LDAP_END_DECL
|
||||
|
||||
|
|
|
|||
|
|
@ -299,7 +299,8 @@ void ldap_int_utils_init LDAP_P(( void ));
|
|||
/*
|
||||
* in print.c
|
||||
*/
|
||||
int ldap_log_printf LDAP_P((LDAP *ld, int level, const char *fmt, ...));
|
||||
int ldap_log_printf LDAP_P((LDAP *ld, int level, const char *fmt, ...))
|
||||
LDAP_GCCATTR((format(printf, 3, 4)));
|
||||
|
||||
/*
|
||||
* in cache.c
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ int kerberos_check_mutual LDAP_P(( struct ds_bind_arg *res, u_long nonce ));
|
|||
* main.c
|
||||
*/
|
||||
|
||||
RETSIGTYPE log_and_exit LDAP_P(( int exitcode ));
|
||||
RETSIGTYPE log_and_exit LDAP_P(( int exitcode )) LDAP_GCCATTR((noreturn));
|
||||
|
||||
/*
|
||||
* message.c
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
static void split(char *line, int splitchar, char **left, char **right);
|
||||
static void acl_append(AccessControl **l, AccessControl *a);
|
||||
static void access_append(Access **l, Access *a);
|
||||
static void acl_usage(void);
|
||||
static void acl_usage(void) LDAP_GCCATTR((noreturn));
|
||||
#ifdef LDAP_DEBUG
|
||||
static void print_acl(AccessControl *a);
|
||||
static void print_access(Access *b);
|
||||
|
|
|
|||
|
|
@ -19,8 +19,9 @@ static Avlnode *object_classes = NULL;
|
|||
|
||||
int global_schemacheck = 1; /* schemacheck on is default */
|
||||
|
||||
static void oc_usage_old(void);
|
||||
static void oc_usage(void);
|
||||
static void oc_usage_old(void) LDAP_GCCATTR((noreturn));
|
||||
static void oc_usage(void) LDAP_GCCATTR((noreturn));
|
||||
static void at_usage(void) LDAP_GCCATTR((noreturn));
|
||||
|
||||
static char *err2text[] = {
|
||||
"",
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ struct ldentry {
|
|||
|
||||
|
||||
#ifdef LDAP_DEBUG
|
||||
void debug_printf(const char *, ...);
|
||||
void debug_printf(const char *, ...) LDAP_GCCATTR((format(printf, 1, 2)));
|
||||
#else /* LDAP_DEBUG */
|
||||
#define debug_printf (void) /* Ignore "arguments" */
|
||||
#endif /* LDAP_DEBUG */
|
||||
|
|
|
|||
Loading…
Reference in a new issue