# New Ticket Created by  "Art Haas" 
# Please include the string:  [perl #50298]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=50298 >


Hi.

The test for the backtrace() function was failing due to the prototypes
at the start of the test code differing for those listed in the header
file. The patch below fixes things by removing the extra prototypes
and basically copying the sample code from the glibc documentation for
backtrace() into a working example. The patched code successfully built
on my Debian "sid" and Fedora "rawhide" systems and correctly identified
both systems as having the backtrace() function.

Changes: config/auto/backtrace/test_c.in

 test_c.in |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Art Haas
-- 
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822
diff --git a/config/auto/backtrace/test_c.in b/config/auto/backtrace/test_c.in
index 53bc925..5b3d11d 100644
--- a/config/auto/backtrace/test_c.in
+++ b/config/auto/backtrace/test_c.in
@@ -3,16 +3,18 @@
  */
 
 #include <execinfo.h>
-
-void backtrace();
-void backtrace_symbols();
+#include <stdlib.h>
 
 int
 main(int argc, char **argv)
 {
-    backtrace();
-    backtrace_symbols();
-    return 0;
+    void *array[10];
+    size_t size;
+    char **strings;
+    size = backtrace(array, 10);
+    strings = backtrace_symbols(array, size);
+    free(strings);
+    return EXIT_SUCCESS;
 }
 
 /*

Reply via email to