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);
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);
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);
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 );
exit( rc );
}
-
-
-
-
#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,
#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 ));
/* 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 ));
# 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
int errlvl,
int loglvl,
const char *fmt,
- ... ));
+ ... )) LDAP_GCCATTR((format(printf, 3, 4)));
LDAP_END_DECL
# 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 */
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
/*
* 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
* main.c
*/
-RETSIGTYPE log_and_exit LDAP_P(( int exitcode ));
+RETSIGTYPE log_and_exit LDAP_P(( int exitcode )) LDAP_GCCATTR((noreturn));
/*
* message.c
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);
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[] = {
"",
#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 */