Fix compiler warnings
authorMichael Jeanson <mjeanson@efficios.com>
Fri, 25 Nov 2022 15:56:11 +0000 (10:56 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 25 Nov 2022 20:33:33 +0000 (15:33 -0500)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/side/trace.h
src/Makefile.am
src/side.c
src/test.c
src/tracer.c
src/tracer.h [deleted file]
tests/Makefile.am

index a5461fcde904c4f0100b99ff09c8591af25e98d4..235382ede061e02d41d6d5e5475368bda2f4b4be 100644 (file)
@@ -518,18 +518,18 @@ struct side_arg_static {
        void *side_vla_app_visitor_ctx;
 
        /* Gather basic types */
-       void *side_bool_gather_ptr;
-       void *side_byte_gather_ptr;
-       void *side_integer_gather_ptr;
-       void *side_float_gather_ptr;
-       void *side_string_gather_ptr;
+       const void *side_bool_gather_ptr;
+       const void *side_byte_gather_ptr;
+       const void *side_integer_gather_ptr;
+       const void *side_float_gather_ptr;
+       const void *side_string_gather_ptr;
 
        /* Gather compound types */
-       void *side_array_gather_ptr;
-       void *side_struct_gather_ptr;
+       const void *side_array_gather_ptr;
+       const void *side_struct_gather_ptr;
        struct {
-               void *ptr;
-               void *length_ptr;
+               const void *ptr;
+               const void *length_ptr;
        } SIDE_PACKED side_vla_gather;
 } SIDE_PACKED;
 
@@ -1820,8 +1820,8 @@ void side_tracer_event_notification_unregister(struct side_tracer_handle *handle
  * Explicit hooks to initialize/finalize the side instrumentation
  * library. Those are also library constructor/destructor.
  */
-void side_init(void);
-void side_exit(void);
+void side_init(void) __attribute__((constructor));
+void side_exit(void) __attribute__((destructor));
 
 /*
  * The following constructors/destructors perform automatic registration
index a96a01ebd7321e576c71b0480078b8a9c7d60e11..c1ebfd1971db9a01114a16d5beac065e4c5e01f7 100644 (file)
@@ -20,8 +20,7 @@ lib_LTLIBRARIES = libside.la
 libside_la_SOURCES = \
        list.h \
        side.c \
-       tracer.c \
-       tracer.h
+       tracer.c
 
 libside_la_LDFLAGS = -no-undefined -version-info $(SIDE_LIBRARY_VERSION)
 libside_la_LIBADD = \
index e212d8e4de4c5404921fe7d873adf187b52b882a..9196c09e4215a64fb1c4f50912df88564e9c6903 100644 (file)
@@ -6,7 +6,6 @@
 #include <side/trace.h>
 #include <string.h>
 
-#include "tracer.h"
 #include "rcu.h"
 #include "list.h"
 
@@ -63,9 +62,6 @@ static DEFINE_SIDE_LIST_HEAD(side_tracer_list);
  */
 const struct side_callback side_empty_callback = { };
 
-void side_init(void) __attribute__((constructor));
-void side_exit(void) __attribute__((destructor));
-
 void side_call(const struct side_event_description *desc, const struct side_arg_vec *side_arg_vec)
 {
        struct side_rcu_read_state rcu_read_state;
@@ -201,7 +197,7 @@ int side_tracer_callback_variadic_register(struct side_event_description *desc,
        return _side_tracer_callback_register(desc, (void *) call_variadic, priv);
 }
 
-int _side_tracer_callback_unregister(struct side_event_description *desc,
+static int _side_tracer_callback_unregister(struct side_event_description *desc,
                void *call, void *priv)
 {
        struct side_callback *old_cb, *new_cb;
index dc7016275118b4fb4749c21f02d39bb54e756fa4..f258a37eb19b31257a229e14b6189722d3eb5cd3 100644 (file)
@@ -11,7 +11,6 @@
 #include <stddef.h>
 
 #include <side/trace.h>
-#include "tracer.h"
 
 /* User code example */
 
@@ -2138,8 +2137,8 @@ static
 void test_gather_string(void)
 {
        side_event_cond(my_provider_event_gatherstring) {
-               char *str1 = "abcdef";
-               char *ptrarray[3] = {
+               const char *str1 = "abcdef";
+               const char *ptrarray[3] = {
                        "abc",
                        "def",
                        "ghi",
index aea52dc8c357e7411bf66e16de9c65246b2a5fb2..8dd938807912af54f86fe2bb00b805e1b900795f 100644 (file)
@@ -1686,6 +1686,7 @@ void tracer_print_static_fields(const struct side_event_description *desc,
                printf(" ]");
 }
 
+static
 void tracer_call(const struct side_event_description *desc,
                const struct side_arg_vec *side_arg_vec,
                void *priv __attribute__((unused)))
@@ -1696,6 +1697,7 @@ void tracer_call(const struct side_event_description *desc,
        printf("\n");
 }
 
+static
 void tracer_call_variadic(const struct side_event_description *desc,
                const struct side_arg_vec *side_arg_vec,
                const struct side_arg_dynamic_struct *var_struct,
@@ -1721,8 +1723,10 @@ void tracer_call_variadic(const struct side_event_description *desc,
        printf("\n");
 }
 
+static
 void tracer_event_notification(enum side_tracer_notification notif,
-               struct side_event_description **events, uint32_t nr_events, void *priv)
+               struct side_event_description **events, uint32_t nr_events,
+               void *priv __attribute__((unused)))
 {
        uint32_t i;
        int ret;
diff --git a/src/tracer.h b/src/tracer.h
deleted file mode 100644 (file)
index 1a3465b..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: MIT
-/*
- * Copyright 2022 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- */
-
-#ifndef _TRACER_H
-#define _TRACER_H
-
-#include <side/trace.h>
-
-void tracer_call(const struct side_event_description *desc,
-       const struct side_arg_vec *side_arg_vec,
-       void *priv);
-void tracer_call_variadic(const struct side_event_description *desc,
-       const struct side_arg_vec *side_arg_vec,
-       const struct side_arg_dynamic_struct *var_struct,
-       void *priv);
-
-#endif
index 1e3a7c85a9d7933bf4c9ebc87d40a6dd4c8c1786..be44e3e99a6f491863b09076b4e757d3e09b1b80 100644 (file)
@@ -20,7 +20,8 @@ regression_side_rcu_test_LDADD = \
        $(top_builddir)/src/librcu.la \
        $(top_builddir)/src/libsmp.la \
        $(top_builddir)/src/libside.la \
-       $(top_builddir)/tests/utils/libtap.la
+       $(top_builddir)/tests/utils/libtap.la \
+       $(RSEQ_LIBS)
 
 # Currently no tap tests to run
 TESTS =
This page took 0.027949 seconds and 4 git commands to generate.