Blame SOURCES/glibc-rh1505492-systemtap.patch

25845f
commit 520d437b9455560d099fe6bd9664be1f9f76868b
25845f
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
25845f
Date:   Tue Dec 3 12:26:12 2013 +0530
25845f
25845f
    [BZ #16195] Fix build warnings from systemtap probes in non-systemtap configurations
25845f
    
25845f
    Joseph pointed out in the bug report (and in an earlier thread) that
25845f
    systemtap probes cause build time warnings like the following:
25845f
    
25845f
        ../sysdeps/ieee754/dbl-64/e_atan2.c:602:4: warning: the address of
25845f
        'p' will always evaluate as 'true' [-Waddress]
25845f
    
25845f
    due to the fact that we're now passing non-weak variables to
25845f
    LIBC_PROBE in the libm probes.  This happens only on configurations
25845f
    that do not enable systemtap.  The macro definition of LIBC_PROBE in
25845f
    this case only acts as a sanity checker to ensure that the number
25845f
    parameters passed to LIBC_PROBE is equal to the argument count
25845f
    parameter passed before it.  This can be done in a much simpler manner
25845f
    by just adding a macro definition for each number of arguments.  I am
25845f
    assuming here that we don't really want to bother with supporting
25845f
    LIBC_PROBE with an indeterminate number of arguments and if there is a
25845f
    need for a probe to have more data than what is currently supported (4
25845f
    arguments), one could simply add an additional macro here.
25845f
25845f
diff --git a/include/stap-probe.h b/include/stap-probe.h
25845f
index 0f65c29b2b5c5dde..0ddb5d5fc9f740dd 100644
25845f
--- a/include/stap-probe.h
25845f
+++ b/include/stap-probe.h
25845f
@@ -49,13 +49,14 @@
25845f
 
25845f
 # ifndef __ASSEMBLER__
25845f
 /* Evaluate all the arguments and verify that N matches their number.  */
25845f
-#  define LIBC_PROBE(name, n, ...)					      \
25845f
-  do {									      \
25845f
-    _Bool __libc_probe_args[] = { 0, ## __VA_ARGS__ };			      \
25845f
-    _Bool __libc_probe_verify_n[(sizeof __libc_probe_args / sizeof (_Bool))   \
25845f
-                                == n + 1 ? 1 : -1];			      \
25845f
-    (void) __libc_probe_verify_n;					      \
25845f
-  } while (0)
25845f
+#define LIBC_PROBE(name, n, ...) STAP_PROBE##n (__VA_ARGS__)
25845f
+
25845f
+#define STAP_PROBE0()
25845f
+#define STAP_PROBE1(a1)
25845f
+#define STAP_PROBE2(a1, a2)
25845f
+#define STAP_PROBE3(a1, a2, a3)
25845f
+#define STAP_PROBE4(a1, a2, a3, a4)
25845f
+
25845f
 # else
25845f
 #  define LIBC_PROBE(name, n, ...)		/* Nothing.  */
25845f
 # endif