Fix all -Wmissing-declarations warning instances
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 25 Nov 2019 21:41:29 +0000 (16:41 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 10 Mar 2020 01:51:23 +0000 (21:51 -0400)
This fixes all the remaining -Wmissing-declarations warning occurences.
The changes either:

- Make functions static
- Remove unused functions
- Add declarations for functions that are meant to be exported in a
  shared object to override some other function (e.g.
  lttng_ust_clock_plugin_init).  There isn't really a better place for
  these declarations.

Change-Id: If08855b75bf44dfdcfbdd654c272474ad8ebef39
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
extras/bindings/swig/python/lttng.i.in
tests/regression/kernel/select_poll_epoll.c
tests/regression/tools/notification/notification.c
tests/regression/tools/rotation/schedule_api.c
tests/regression/ust/clock-override/lttng-ust-clock-override-test.c
tests/regression/ust/getcpu-override/lttng-ust-getcpu-override-test.c
tests/regression/ust/high-throughput/main.c
tests/regression/ust/multi-lib/callsites.c
tests/regression/ust/multi-lib/multi-lib-test.c

index e99c9aecf53750b1c31e54dc7db67d3c7a69990a..b6b6f960eba7720955611e3adbeceaa3679195e2 100644 (file)
@@ -29,6 +29,9 @@ multiple concurrent processes and threads. Tracing across multiple systems is al
 // This makes the typemap code useable with both Python 2 and 3.
 #define PyInt_AsSsize_t PyLong_AsSsize_t
 #endif
 // This makes the typemap code useable with both Python 2 and 3.
 #define PyInt_AsSsize_t PyLong_AsSsize_t
 #endif
+
+// Avoid -Wmissing-declarations warning.
+PyObject *SWIG_init(void);
 %}
 
 typedef unsigned int uint32_t;
 %}
 
 typedef unsigned int uint32_t;
index 33b8cb5d5d100d29ac18777ba68ae996e1ced057..3c9a4b15d0b8aea3c86dc0cd5ef9b59c55d98307 100644 (file)
@@ -46,6 +46,7 @@ struct ppoll_thread_data {
        int value;
 };
 
        int value;
 };
 
+static
 void test_select_big(void)
 {
        fd_set rfds, wfds, exfds;
 void test_select_big(void)
 {
        fd_set rfds, wfds, exfds;
@@ -95,6 +96,7 @@ end:
        return;
 }
 
        return;
 }
 
+static
 void test_pselect(void)
 {
        fd_set rfds;
 void test_pselect(void)
 {
        fd_set rfds;
@@ -128,6 +130,7 @@ void test_pselect(void)
 
 }
 
 
 }
 
+static
 void test_select(void)
 {
        fd_set rfds;
 void test_select(void)
 {
        fd_set rfds;
@@ -161,6 +164,7 @@ void test_select(void)
 
 }
 
 
 }
 
+static
 void test_poll(void)
 {
        struct pollfd ufds[NB_FD];
 void test_poll(void)
 {
        struct pollfd ufds[NB_FD];
@@ -185,6 +189,7 @@ void test_poll(void)
        }
 }
 
        }
 }
 
+static
 void test_ppoll(void)
 {
        struct pollfd ufds[NB_FD];
 void test_ppoll(void)
 {
        struct pollfd ufds[NB_FD];
@@ -217,6 +222,7 @@ void test_ppoll(void)
        }
 }
 
        }
 }
 
+static
 void test_ppoll_big(void)
 {
        struct pollfd ufds[MAX_FDS];
 void test_ppoll_big(void)
 {
        struct pollfd ufds[MAX_FDS];
@@ -256,6 +262,7 @@ void test_ppoll_big(void)
        return;
 }
 
        return;
 }
 
+static
 void test_epoll(void)
 {
        int ret, epollfd;
 void test_epoll(void)
 {
        int ret, epollfd;
@@ -298,6 +305,7 @@ end:
        return;
 }
 
        return;
 }
 
+static
 void test_pepoll(void)
 {
        int ret, epollfd;
 void test_pepoll(void)
 {
        int ret, epollfd;
@@ -340,6 +348,7 @@ end:
        return;
 }
 
        return;
 }
 
+static
 void run_working_cases(void)
 {
        int ret;
 void run_working_cases(void)
 {
        int ret;
@@ -386,6 +395,7 @@ end:
  * segfault (eventually with a "*** stack smashing detected ***" message).
  * The event should contain an array of 100 FDs filled with garbage.
  */
  * segfault (eventually with a "*** stack smashing detected ***" message).
  * The event should contain an array of 100 FDs filled with garbage.
  */
+static
 void ppoll_fds_buffer_overflow(void)
 {
        struct pollfd ufds[NB_FD];
 void ppoll_fds_buffer_overflow(void)
 {
        struct pollfd ufds[NB_FD];
@@ -417,6 +427,7 @@ void ppoll_fds_buffer_overflow(void)
  * cleanly fail with a "Invalid argument".
  * The event should contain an empty array of FDs and overflow = 1.
  */
  * cleanly fail with a "Invalid argument".
  * The event should contain an empty array of FDs and overflow = 1.
  */
+static
 void ppoll_fds_ulong_max(void)
 {
        struct pollfd ufds[NB_FD];
 void ppoll_fds_ulong_max(void)
 {
        struct pollfd ufds[NB_FD];
@@ -447,6 +458,7 @@ void ppoll_fds_ulong_max(void)
  * Pass an invalid file descriptor to pselect6(). The syscall should return
  * -EBADF. The recorded event should contain a "ret = -EBADF (-9)".
  */
  * Pass an invalid file descriptor to pselect6(). The syscall should return
  * -EBADF. The recorded event should contain a "ret = -EBADF (-9)".
  */
+static
 void pselect_invalid_fd(void)
 {
        fd_set rfds;
 void pselect_invalid_fd(void)
 {
        fd_set rfds;
@@ -493,6 +505,7 @@ error:
  * Invalid pointer as writefds, should output a ppoll event
  * with 0 FDs.
  */
  * Invalid pointer as writefds, should output a ppoll event
  * with 0 FDs.
  */
+static
 void pselect_invalid_pointer(void)
 {
        fd_set rfds;
 void pselect_invalid_pointer(void)
 {
        fd_set rfds;
@@ -524,6 +537,7 @@ void pselect_invalid_pointer(void)
  * Pass an invalid pointer to epoll_pwait, should fail with
  * "Bad address", the event returns 0 FDs.
  */
  * Pass an invalid pointer to epoll_pwait, should fail with
  * "Bad address", the event returns 0 FDs.
  */
+static
 void epoll_pwait_invalid_pointer(void)
 {
        int ret, epollfd;
 void epoll_pwait_invalid_pointer(void)
 {
        int ret, epollfd;
@@ -568,6 +582,7 @@ end:
  * Set maxevents to INT_MAX, should output "Invalid argument"
  * The event should return an empty array.
  */
  * Set maxevents to INT_MAX, should output "Invalid argument"
  * The event should return an empty array.
  */
+static
 void epoll_pwait_int_max(void)
 {
        int ret, epollfd;
 void epoll_pwait_int_max(void)
 {
        int ret, epollfd;
@@ -607,6 +622,7 @@ end:
        return;
 }
 
        return;
 }
 
+static
 void *ppoll_writer(void *arg)
 {
        struct ppoll_thread_data *data = (struct ppoll_thread_data *) arg;
 void *ppoll_writer(void *arg)
 {
        struct ppoll_thread_data *data = (struct ppoll_thread_data *) arg;
@@ -620,6 +636,7 @@ void *ppoll_writer(void *arg)
        return NULL;
 }
 
        return NULL;
 }
 
+static
 void do_ppoll(int *fds, struct pollfd *ufds)
 {
        int i, ret;
 void do_ppoll(int *fds, struct pollfd *ufds)
 {
        int i, ret;
@@ -649,6 +666,7 @@ void do_ppoll(int *fds, struct pollfd *ufds)
        }
 }
 
        }
 }
 
+static
 void stress_ppoll(int *fds, int value)
 {
        pthread_t writer;
 void stress_ppoll(int *fds, int value)
 {
        pthread_t writer;
@@ -690,6 +708,7 @@ end:
  *
  * ppoll should work as expected and the trace should be readable at the end.
  */
  *
  * ppoll should work as expected and the trace should be readable at the end.
  */
+static
 void ppoll_concurrent_write(void)
 {
        int i, ret, fds[MAX_FDS];
 void ppoll_concurrent_write(void)
 {
        int i, ret, fds[MAX_FDS];
@@ -715,6 +734,7 @@ void ppoll_concurrent_write(void)
        return;
 }
 
        return;
 }
 
+static
 void *epoll_pwait_writer(void *addr)
 {
        srand(time(NULL));
 void *epoll_pwait_writer(void *addr)
 {
        srand(time(NULL));
@@ -732,6 +752,7 @@ void *epoll_pwait_writer(void *addr)
  * buffer allocated for the returned data. This should randomly segfault.
  * The trace should be readable and no kernel OOPS should occur.
  */
  * buffer allocated for the returned data. This should randomly segfault.
  * The trace should be readable and no kernel OOPS should occur.
  */
+static
 void epoll_pwait_concurrent_munmap(void)
 {
        int ret, epollfd, i, fds[MAX_FDS];
 void epoll_pwait_concurrent_munmap(void)
 {
        int ret, epollfd, i, fds[MAX_FDS];
@@ -814,15 +835,7 @@ end:
        return;
 }
 
        return;
 }
 
-void usage(poptContext optCon, int exitcode, char *error, char *addl)
-{
-       poptPrintUsage(optCon, stderr, 0);
-       if (error) {
-               fprintf(stderr, "%s: %s\n", error, addl);
-       }
-       exit(exitcode);
-}
-
+static
 void print_list(void)
 {
        fprintf(stderr, "Test list (-t X):\n");
 void print_list(void)
 {
        fprintf(stderr, "Test list (-t X):\n");
index 68ec64d01cee1fd1c64b1b9500f90e9a77148bb9..535a71fce7fd8b5cbda2fa9a4086866b4d372007 100644 (file)
@@ -87,6 +87,7 @@ void wait_on_file(const char *path, bool file_exist)
        }
 }
 
        }
 }
 
+static
 int write_pipe(const char *path, uint8_t data)
 {
        int ret = 0;
 int write_pipe(const char *path, uint8_t data)
 {
        int ret = 0;
@@ -118,6 +119,7 @@ end:
        return ret;
 }
 
        return ret;
 }
 
+static
 int stop_consumer(const char **argv)
 {
        int ret = 0, i;
 int stop_consumer(const char **argv)
 {
        int ret = 0, i;
@@ -128,6 +130,7 @@ int stop_consumer(const char **argv)
        return ret;
 }
 
        return ret;
 }
 
+static
 int resume_consumer(const char **argv)
 {
        int ret = 0, i;
 int resume_consumer(const char **argv)
 {
        int ret = 0, i;
@@ -138,7 +141,8 @@ int resume_consumer(const char **argv)
        return ret;
 }
 
        return ret;
 }
 
-int suspend_application()
+static
+int suspend_application(void)
 {
        int ret;
        struct stat buf;
 {
        int ret;
        struct stat buf;
@@ -166,6 +170,7 @@ error:
 
 }
 
 
 }
 
+static
 int resume_application()
 {
        int ret;
 int resume_application()
 {
        int ret;
@@ -196,6 +201,7 @@ error:
 }
 
 
 }
 
 
+static
 void test_triggers_buffer_usage_condition(const char *session_name,
                const char *channel_name,
                enum lttng_domain_type domain_type,
 void test_triggers_buffer_usage_condition(const char *session_name,
                const char *channel_name,
                enum lttng_domain_type domain_type,
@@ -389,6 +395,7 @@ void wait_data_pending(const char *session_name)
        } while (ret != 0);
 }
 
        } while (ret != 0);
 }
 
+static
 void test_notification_channel(const char *session_name, const char *channel_name, const enum lttng_domain_type domain_type, const char **argv)
 {
        int ret = 0;
 void test_notification_channel(const char *session_name, const char *channel_name, const enum lttng_domain_type domain_type, const char **argv)
 {
        int ret = 0;
index 03c446fcb498c7f50309ecc21e35268d178e98f5..61146856379f500d2b3dde2f96897655b21cf0b6 100644 (file)
@@ -22,6 +22,7 @@
 
 const char *session_name;
 
 
 const char *session_name;
 
+static
 bool schedules_equal(const struct lttng_rotation_schedule *a,
                const struct lttng_rotation_schedule *b)
 {
 bool schedules_equal(const struct lttng_rotation_schedule *a,
                const struct lttng_rotation_schedule *b)
 {
@@ -84,6 +85,7 @@ end:
        return equal;
 }
 
        return equal;
 }
 
+static
 void test_add_null_session(void)
 {
        enum lttng_rotation_status status;
 void test_add_null_session(void)
 {
        enum lttng_rotation_status status;
@@ -97,6 +99,7 @@ void test_add_null_session(void)
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
+static
 void test_add_null_schedule(void)
 {
        enum lttng_rotation_status status;
 void test_add_null_schedule(void)
 {
        enum lttng_rotation_status status;
@@ -106,6 +109,7 @@ void test_add_null_schedule(void)
                        "NULL schedule rejected by lttng_session_add_rotation_schedule()");
 }
 
                        "NULL schedule rejected by lttng_session_add_rotation_schedule()");
 }
 
+static
 void test_add_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
 void test_add_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
@@ -132,6 +136,7 @@ void test_add_uninitialized_schedule(void)
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
+static
 void test_remove_null_session(void)
 {
        enum lttng_rotation_status status;
 void test_remove_null_session(void)
 {
        enum lttng_rotation_status status;
@@ -145,6 +150,7 @@ void test_remove_null_session(void)
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
+static
 void test_remove_null_schedule(void)
 {
        enum lttng_rotation_status status;
 void test_remove_null_schedule(void)
 {
        enum lttng_rotation_status status;
@@ -154,6 +160,7 @@ void test_remove_null_schedule(void)
                        "NULL schedule rejected by lttng_session_remove_rotation_schedule()");
 }
 
                        "NULL schedule rejected by lttng_session_remove_rotation_schedule()");
 }
 
+static
 void test_remove_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
 void test_remove_uninitialized_schedule(void)
 {
        enum lttng_rotation_status status;
@@ -176,6 +183,7 @@ void test_remove_uninitialized_schedule(void)
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
        lttng_rotation_schedule_destroy(periodic_schedule);
 }
 
+static
 void test_uninitialized_schedule_get(void)
 {
        uint64_t value;
 void test_uninitialized_schedule_get(void)
 {
        uint64_t value;
@@ -200,6 +208,7 @@ void test_uninitialized_schedule_get(void)
 
 }
 
 
 }
 
+static
 void test_add_list_remove_schedule(
                const struct lttng_rotation_schedule *original_schedule)
 {
 void test_add_list_remove_schedule(
                const struct lttng_rotation_schedule *original_schedule)
 {
@@ -249,6 +258,7 @@ void test_add_list_remove_schedule(
 
 }
 
 
 }
 
+static
 void test_add_list_remove_size_schedule(void)
 {
        struct lttng_rotation_schedule *size_schedule;
 void test_add_list_remove_size_schedule(void)
 {
        struct lttng_rotation_schedule *size_schedule;
@@ -261,6 +271,7 @@ void test_add_list_remove_size_schedule(void)
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
        lttng_rotation_schedule_destroy(size_schedule);
 }
 
+static
 void test_add_list_remove_periodic_schedule(void)
 {
        struct lttng_rotation_schedule *periodic_schedule;
 void test_add_list_remove_periodic_schedule(void)
 {
        struct lttng_rotation_schedule *periodic_schedule;
index b2c20bee3819cddde3ec29af1f82997b34efd4a4..dace1d99cba4fef0d7ccf86bd4a6b8a99782202f 100644 (file)
@@ -49,6 +49,7 @@ const char *plugin_description(void)
        return "Freeze time with 1KHz for regression test";
 }
 
        return "Freeze time with 1KHz for regression test";
 }
 
+void lttng_ust_clock_plugin_init(void);
 void lttng_ust_clock_plugin_init(void)
 {
        int ret;
 void lttng_ust_clock_plugin_init(void)
 {
        int ret;
index f1b70742591322cc8c50e021c52779bd89952a72..976bcb231ddab0fe2664ae216ad073eb4b9e4fb2 100644 (file)
@@ -18,6 +18,7 @@
 
 static long nprocessors;
 
 
 static long nprocessors;
 
+static
 int plugin_getcpu(void)
 {
        /* Generate a sequence based on the number of configurated processor
 int plugin_getcpu(void)
 {
        /* Generate a sequence based on the number of configurated processor
@@ -57,6 +58,7 @@ int plugin_getcpu(void)
        return ret;
 }
 
        return ret;
 }
 
+void lttng_ust_getcpu_plugin_init(void);
 void lttng_ust_getcpu_plugin_init(void)
 {
        int ret;
 void lttng_ust_getcpu_plugin_init(void)
 {
        int ret;
index b59c9241f3bdc3e9b6dacda2eb364223ef97d169..092d8015fc20a3384766bc43b0a2686510cd24ab 100644 (file)
 #define TRACEPOINT_DEFINE
 #include "tp.h"
 
 #define TRACEPOINT_DEFINE
 #include "tp.h"
 
+static
 void inthandler(int sig)
 {
 }
 
 void inthandler(int sig)
 {
 }
 
+static
 int init_int_handler(void)
 {
        int result;
 int init_int_handler(void)
 {
        int result;
index eaa6137085cbe133b22411bb09bfb99f9196e3ba..a67f102b498674b2b3eb92b6b0701e0c2cea6e23 100644 (file)
@@ -18,7 +18,9 @@
 #define VALUE (-1)
 #endif
 
 #define VALUE (-1)
 #endif
 
-void call_tracepoint(void) {
+void call_tracepoint(void);
+void call_tracepoint(void)
+{
        tracepoint(multi, tp, VALUE);
 }
 
        tracepoint(multi, tp, VALUE);
 }
 
index 6a91089df27dc0c1281060d0e11a897354237efd..218b1196be438ce2d6402e4891605db8a841a0b8 100644 (file)
@@ -15,6 +15,7 @@
 #include "callsites.h"
 #endif
 
 #include "callsites.h"
 #endif
 
+void exec_callsite();
 void exec_callsite()
 {
 #if HAS_CALLSITES
 void exec_callsite()
 {
 #if HAS_CALLSITES
@@ -22,6 +23,7 @@ void exec_callsite()
 #endif
 }
 
 #endif
 }
 
+static
 void print_list(void)
 {
        fprintf(stderr, "Test list (-t X):\n");
 void print_list(void)
 {
        fprintf(stderr, "Test list (-t X):\n");
@@ -31,6 +33,8 @@ void print_list(void)
        fprintf(stderr, "\t2: simulate the upgrade of a library containing the callsites using dlopen() and dlclose(). \n");
 }
 
        fprintf(stderr, "\t2: simulate the upgrade of a library containing the callsites using dlopen() and dlclose(). \n");
 }
 
+#if HAS_CALLSITES
+static
 int dl_open_all(int nb_libraries, char **libraries)
 {
        int i, ret = 0;
 int dl_open_all(int nb_libraries, char **libraries)
 {
        int i, ret = 0;
@@ -61,6 +65,7 @@ error:
  * Takes 2 paths to libraries, dlopen() the first, trace, dlopen() the second,
  * and dlclose the first to simulate the upgrade of a library.
  */
  * Takes 2 paths to libraries, dlopen() the first, trace, dlopen() the second,
  * and dlclose the first to simulate the upgrade of a library.
  */
+static
 int upgrade_lib(int nb_libraries, char **libraries)
 {
        int i, ret = 0;
 int upgrade_lib(int nb_libraries, char **libraries)
 {
        int i, ret = 0;
@@ -92,11 +97,14 @@ int upgrade_lib(int nb_libraries, char **libraries)
 error:
        return ret;
 }
 error:
        return ret;
 }
+#endif /* HAS_CALLSITES */
 
 
+#if !HAS_CALLSITES
 /*
  * Simulate the upgrade of a library containing a callsite.
  * Receives two libraries containing callsites for the same tracepoint.
  */
 /*
  * Simulate the upgrade of a library containing a callsite.
  * Receives two libraries containing callsites for the same tracepoint.
  */
+static
 int upgrade_callsite(int nb_libraries, char **libraries)
 {
        int ret = 0;
 int upgrade_callsite(int nb_libraries, char **libraries)
 {
        int ret = 0;
@@ -159,6 +167,7 @@ int upgrade_callsite(int nb_libraries, char **libraries)
 error:
        return ret;
 }
 error:
        return ret;
 }
+#endif /* !HAS_CALLSITES */
 
 int main(int argc, const char **argv)
 {
 
 int main(int argc, const char **argv)
 {
This page took 0.033133 seconds and 4 git commands to generate.