Add missing function attributes suggested by clang (but not by gcc)

clang is a little more enthusiastic about suggesting these.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
Simon McVittie 2016-10-07 19:45:48 +01:00 committed by Simon McVittie
parent 27b7e2b88a
commit 7959d90719
23 changed files with 83 additions and 1 deletions

View file

@ -132,6 +132,8 @@ signal_handler (int sig)
}
#endif /* DBUS_UNIX */
static void usage (void) _DBUS_GNUC_NORETURN;
static void
usage (void)
{
@ -158,6 +160,8 @@ usage (void)
exit (1);
}
static void version (void) _DBUS_GNUC_NORETURN;
static void
version (void)
{
@ -169,6 +173,8 @@ version (void)
exit (0);
}
static void introspect (void) _DBUS_GNUC_NORETURN;
static void
introspect (void)
{

View file

@ -34,6 +34,8 @@
#error This file is only relevant for the embedded tests on Unix
#endif
static void die (const char *failure) _DBUS_GNUC_NORETURN;
static void
die (const char *failure)
{

View file

@ -39,6 +39,8 @@
# include <dbus/dbus-sysdeps-unix.h>
#endif
static void die (const char *failure) _DBUS_GNUC_NORETURN;
static void
die (const char *failure)
{

View file

@ -33,6 +33,8 @@
#error This file is only relevant for the embedded tests on Unix
#endif
static void die (const char *failure) _DBUS_GNUC_NORETURN;
static void
die (const char *failure)
{

View file

@ -976,6 +976,8 @@ do_write (int fd, const void *buf, size_t count)
goto again;
}
static void write_err_and_exit (int fd, int msg) _DBUS_GNUC_NORETURN;
static void
write_err_and_exit (int fd, int msg)
{
@ -996,6 +998,8 @@ write_pid (int fd, pid_t pid)
do_write (fd, &pid, sizeof (pid));
}
static void write_status_and_exit (int fd, int status) _DBUS_GNUC_NORETURN;
static void
write_status_and_exit (int fd, int status)
{
@ -1007,6 +1011,12 @@ write_status_and_exit (int fd, int status)
exit (0);
}
static void do_exec (int child_err_report_fd,
char * const *argv,
char * const *envp,
DBusSpawnChildSetupFunc child_setup,
void *user_data) _DBUS_GNUC_NORETURN;
static void
do_exec (int child_err_report_fd,
char * const *argv,
@ -1125,6 +1135,9 @@ babysit_signal_handler (int signo)
goto again;
}
static void babysit (pid_t grandchild_pid,
int parent_pipe) _DBUS_GNUC_NORETURN;
static void
babysit (pid_t grandchild_pid,
int parent_pipe)

View file

@ -29,6 +29,8 @@
#include <stdlib.h>
#ifdef DBUS_ENABLE_EMBEDDED_TESTS
static void die (const char *failure) _DBUS_GNUC_NORETURN;
static void
die (const char *failure)
{

View file

@ -8,6 +8,8 @@
#include <unistd.h>
#endif
static void die (const char *message) _DBUS_GNUC_NORETURN;
static void
die (const char *message)
{

View file

@ -1,6 +1,9 @@
#include <config.h>
#include "../test-utils.h"
static void die (const char *message,
...) _DBUS_GNUC_NORETURN _DBUS_GNUC_PRINTF (1, 2);
static void
die (const char *message, ...)
{

View file

@ -1,6 +1,9 @@
#include <config.h>
#include "../test-utils.h"
static void die (const char *message,
...) _DBUS_GNUC_NORETURN _DBUS_GNUC_PRINTF (1, 2);
static void
die (const char *message, ...)
{

View file

@ -4,6 +4,8 @@
static DBusLoop *loop;
static void die (const char *message) _DBUS_GNUC_NORETURN;
static void
die (const char *message)
{

View file

@ -3,6 +3,8 @@
static DBusLoop *loop;
static void die (const char *message) _DBUS_GNUC_NORETURN;
static void
die (const char *message)
{

View file

@ -19,6 +19,8 @@ quit (void)
}
}
static void die (const char *message) _DBUS_GNUC_NORETURN;
static void
die (const char *message)
{

View file

@ -22,6 +22,8 @@ quit (void)
}
}
static void die (const char *message) _DBUS_GNUC_NORETURN;
static void
die (const char *message)
{

View file

@ -429,6 +429,8 @@ time_out (gpointer data)
}
#ifdef G_OS_UNIX
static void wrap_abort (int signal) _DBUS_GNUC_NORETURN;
static void
wrap_abort (int signal)
{

View file

@ -151,6 +151,8 @@ test_connection_setup (TestMainContext *ctx,
return FALSE;
}
static void die (const char *message) _DBUS_GNUC_NORETURN;
static void
die (const char *message)
{

View file

@ -40,6 +40,8 @@ static int sleep_ms = -1;
static dbus_bool_t noreply = FALSE;
static dbus_bool_t noread = FALSE;
static void usage_echo (int exit_with) _DBUS_GNUC_NORETURN;
static void
usage_echo (int exit_with)
{
@ -60,6 +62,8 @@ usage_echo (int exit_with)
exit (exit_with);
}
static void usage_black_hole (int exit_with) _DBUS_GNUC_NORETURN;
static void
usage_black_hole (int exit_with)
{

View file

@ -164,6 +164,8 @@ verbose (const char *format,
#endif /* DBUS_ENABLE_VERBOSE_MODE */
}
static void usage (int ecode) _DBUS_GNUC_NORETURN;
static void
usage (int ecode)
{
@ -174,6 +176,8 @@ usage (int ecode)
exit (ecode);
}
static void version (void) _DBUS_GNUC_NORETURN;
static void
version (void)
{
@ -470,6 +474,8 @@ signal_handler (int sig)
}
}
static void kill_bus_when_session_ends (void) _DBUS_GNUC_NORETURN;
static void
kill_bus_when_session_ends (void)
{
@ -607,6 +613,7 @@ kill_bus_when_session_ends (void)
}
}
}
/* not reached */
}
_DBUS_GNUC_NORETURN static void
@ -736,6 +743,12 @@ do_close_stderr (void)
}
}
static void pass_info (const char *runprog, const char *bus_address,
pid_t bus_pid, long bus_wid, int c_shell_syntax,
int bourne_shell_syntax, int binary_syntax,
int argc, char **argv,
int remaining_args) _DBUS_GNUC_NORETURN;
static void
pass_info (const char *runprog, const char *bus_address, pid_t bus_pid,
long bus_wid, int c_shell_syntax, int bourne_shell_syntax,

View file

@ -42,7 +42,7 @@
#define MAX_ADDR_LEN 512
/* defined in dbus-launch.c */
void verbose (const char *format, ...);
void verbose (const char *format, ...) _DBUS_GNUC_PRINTF (1, 2);
char *xstrdup (const char *str);
void kill_bus_and_exit (int exitcode) _DBUS_GNUC_NORETURN;

View file

@ -262,6 +262,8 @@ binary_filter_func (DBusConnection *connection,
return DBUS_HANDLER_RESULT_HANDLED;
}
static void usage (char *name, int ecode) _DBUS_GNUC_NORETURN;
static void
usage (char *name, int ecode)
{

View file

@ -65,6 +65,8 @@
static const char me[] = "dbus-run-session";
static void usage (int ecode) _DBUS_GNUC_NORETURN;
static void
usage (int ecode)
{
@ -81,6 +83,8 @@ usage (int ecode)
exit (ecode);
}
static void version (void) _DBUS_GNUC_NORETURN;
static void
version (void)
{
@ -95,6 +99,8 @@ version (void)
exit (0);
}
static void oom (void) _DBUS_GNUC_NORETURN;
static void
oom (void)
{
@ -191,6 +197,8 @@ exec_dbus_daemon (const char *dbus_daemon,
me, dbus_daemon, strerror (errno));
}
static void exec_app (int prog_arg, char **argv) _DBUS_GNUC_NORETURN;
static void
exec_app (int prog_arg, char **argv)
{

View file

@ -49,6 +49,8 @@
static const char *appname;
static void usage (int ecode) _DBUS_GNUC_NORETURN;
static void
usage (int ecode)
{

View file

@ -35,6 +35,8 @@
static dbus_bool_t ignore_errors = FALSE;
static void usage (int ecode) _DBUS_GNUC_NORETURN;
static void
usage (int ecode)
{

View file

@ -27,6 +27,8 @@
#include <dbus/dbus-uuidgen.h>
#include <dbus/dbus.h>
static void usage (const char *name, int ecode) _DBUS_GNUC_NORETURN;
static void
usage (const char *name,
int ecode)
@ -38,6 +40,8 @@ usage (const char *name,
exit (ecode);
}
static void version (void) _DBUS_GNUC_NORETURN;
static void
version (void)
{