diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-11-26 12:35:33 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-12-01 06:43:39 +0100 |
commit | ff77bab398157de9c5a271b28708ee02bd735ccb (patch) | |
tree | 6ae3e8b0abcf3dda481154e91bc6e97f6536a47f /utils.h | |
parent | d274a06176156b6eb8b1523375f94cbe5ecbbab7 (diff) |
Warn about unused return values that are quite important.
* CI: ArchLinux build should now instrument `-Werror`
* CI: Increased OpenWrt build verbosity
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'utils.h')
-rw-r--r-- | utils.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -3,6 +3,8 @@ #include <stdarg.h> +#define WARN_UNUSED __attribute__((__warn_unused_result__)) + #define CMDARG(_default_value) \ { \ .value = NULL, .default_value = (_default_value) \ @@ -16,20 +18,26 @@ struct cmdarg void set_cmdarg(struct cmdarg * const ca, char const * const val); +WARN_UNUSED char const * get_cmdarg(struct cmdarg const * const ca); +WARN_UNUSED int is_cmdarg_set(struct cmdarg const * const ca); +WARN_UNUSED int is_path_absolute(char const * const prefix, char const * const path); void daemonize_enable(void); +WARN_UNUSED int is_daemonize_enabled(void); +WARN_UNUSED int daemonize_with_pidfile(char const * const pidfile); int daemonize_shutdown(char const * const pidfile); +WARN_UNUSED int change_user_group(char const * const user, char const * const group, char const * const pidfile, @@ -42,12 +50,15 @@ void log_app_info(void); void shutdown_logging(void); +WARN_UNUSED int enable_file_logger(char const * const log_file); +WARN_UNUSED int get_log_file_fd(void); void enable_console_logger(void); +WARN_UNUSED int is_console_logger_enabled(void); void vlogger(int is_error, char const * const format, va_list ap); @@ -56,8 +67,10 @@ __attribute__((format(printf, 2, 3))) void logger(int is_error, char const * con __attribute__((format(printf, 2, 3))) void logger_early(int is_error, char const * const format, ...); +WARN_UNUSED int set_fd_cloexec(int fd); +WARN_UNUSED char const * get_nDPId_version(void); #endif |