From db558eb8069bbc8c784b10f1be0340ad533c0d95 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Fri, 20 Jul 2007 20:33:13 -0400 Subject: [PATCH] Warn about unused results at compile time. --- libpwmd.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libpwmd.h b/libpwmd.h index 5118fb94..74a501ba 100644 --- a/libpwmd.h +++ b/libpwmd.h @@ -151,14 +151,14 @@ gpg_error_t pwmd_init(void); * with the other functions or NULL if there was an error in which case * 'error' is set to an error code which may be described by pwmd_strerror(). */ -pwm_t *pwmd_connect(const char *socket_path, gpg_error_t *error); +pwm_t *pwmd_connect(const char *socket_path, gpg_error_t *error) __attribute__ ((warn_unused_result)); /* * Opens a file 'filename' (the OPEN command). The password is gotten from the * pinentry program if configured to do so and not already cached. Returnes * 0 on success or an error code. */ -gpg_error_t pwmd_open(pwm_t *pwm, const char *filename); +gpg_error_t pwmd_open(pwm_t *pwm, const char *filename) __attribute__ ((warn_unused_result)); /* * This a nonblocking way of opening a file. It returns -2 when the file is @@ -181,13 +181,13 @@ gpg_error_t pwmd_open(pwm_t *pwm, const char *filename); * * Be sure to set PWMD_OPTION_PINENTRY. */ -int pwmd_open_nb(pwm_t *pwm, gpg_error_t *error, const char *filename, int timeout); -gpg_error_t pwmd_open_nb_finalize(pwm_t *pwm, pwmd_nb_status_t *status); +int pwmd_open_nb(pwm_t *pwm, gpg_error_t *error, const char *filename, int timeout) __attribute__ ((warn_unused_result)); +gpg_error_t pwmd_open_nb_finalize(pwm_t *pwm, pwmd_nb_status_t *status) __attribute__ ((warn_unused_result)); /* * Send's the SAVE command and takes care of password requests. */ -gpg_error_t pwmd_save(pwm_t *pwm); +gpg_error_t pwmd_save(pwm_t *pwm) __attribute__ ((warn_unused_result)); /* * Send's the SAVE protocol command without pinentry blocking the process. It @@ -197,15 +197,15 @@ gpg_error_t pwmd_save(pwm_t *pwm); * * Be sure to set PWMD_OPTION_PINENTRY. */ -int pwmd_save_nb(pwm_t *pwm, gpg_error_t *error); -gpg_error_t pwmd_save_nb_finalize(pwm_t *pwm, pwmd_nb_status_t *status); +int pwmd_save_nb(pwm_t *pwm, gpg_error_t *error) __attribute__ ((warn_unused_result)); +gpg_error_t pwmd_save_nb_finalize(pwm_t *pwm, pwmd_nb_status_t *status) __attribute__ ((warn_unused_result)); /* * Terminates a pinentry process. If your not using pwmd_open_nb() and want to * timeout a password entry, then call this function after your timer has * expired. Returns 0 on success or an error code. */ -gpg_error_t pwmd_terminate_pinentry(pwm_t *pwm); +gpg_error_t pwmd_terminate_pinentry(pwm_t *pwm) __attribute__ ((warn_unused_result)); /* * Closes the connection to the socket and frees the resources of the handle. @@ -226,7 +226,7 @@ void pwmd_close(pwm_t *pwm); * assuan_disconnect() which then send's the BYE command to the closed file * descriptor resulting in a segfault. */ -gpg_error_t pwmd_command(pwm_t *pwm, char **result, const char *cmd, ...); +gpg_error_t pwmd_command(pwm_t *pwm, char **result, const char *cmd, ...) __attribute__ ((warn_unused_result)); /* * Free's the memory used by the result of pwmd_command() if any. It is @@ -239,7 +239,7 @@ void pwmd_free_result(void *); * Sets a libpwmd option 'opt'. The next argument should be of the data type * required for the option. Returns 0 on success or an error code. */ -gpg_error_t pwmd_setopt(pwm_t *pwm, pwmd_option_t opt, ...); +gpg_error_t pwmd_setopt(pwm_t *pwm, pwmd_option_t opt, ...) __attribute__ ((warn_unused_result)); /* * Protocol error codes. -- 2.11.4.GIT