Fix: tests: include callsites.h from callsites.c
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 25 Mar 2020 22:39:52 +0000 (18:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 26 Mar 2020 22:01:40 +0000 (18:01 -0400)
In commit:

    commit f12eb9c1ceb619db54be0842323a32cda12651cd
    Author: Simon Marchi <simon.marchi@efficios.com>
    Date:   Mon Nov 25 16:41:29 2019 -0500

        Fix all -Wmissing-declarations warning instances

I've fixed the -Wmissing-declarations warning in callsites.c by adding a local
declaration.  That was wrong, since there is actually a callsites.h header file
that needs to be included, which contains the declaration.  This is nicely
pointed out when building with clang and -Wstrict-prototypes:

      CC       exec_with_callsites-multi-lib-test.o
    In file included from /home/simark/src/lttng-tools/tests/regression/ust/multi-lib/multi-lib-test.c:15:
    /home/simark/src/lttng-tools/tests/regression/ust/multi-lib/callsites.h:10:21: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
    void call_tracepoint();
                        ^
                         void

Remove the local declaration and include callsites.h in callsites.c.

Change-Id: Ib656d96c2ed3b389697a2022e343e98ac0b66447
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/ust/multi-lib/callsites.c
tests/regression/ust/multi-lib/callsites.h

index a67f102b498674b2b3eb92b6b0701e0c2cea6e23..ed86a0ed975f5fbbc9db3e1e7b4a15c71a72001c 100644 (file)
 #include <time.h>
 #include <pthread.h>
 
+#include "callsites.h"
+
 #ifndef VALUE
 #define VALUE (-1)
 #endif
 
-void call_tracepoint(void);
 void call_tracepoint(void)
 {
        tracepoint(multi, tp, VALUE);
index 367b85b99f1fa9219ae4590e3129620db80fa430..059d8f791e3628fefec4f3c685c21b2e734c5f98 100644 (file)
@@ -7,5 +7,5 @@
 
 #ifndef CALLSITES_H
 #define CALLSITES_H
-void call_tracepoint();
+void call_tracepoint(void);
 #endif /* CALLSITES_H */
This page took 0.027239 seconds and 5 git commands to generate.