This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, libbacktrace]: fix pointer from integer without a cast
- From: "Duncan Mac-Vicar P." <dmacvicar at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: zawertun at gmail dot com
- Date: Thu, 03 Jul 2014 11:34:09 +0200
- Subject: [PATCH, libbacktrace]: fix pointer from integer without a cast
- Authentication-results: sourceware.org; auth=none
Hello
the following patch fixes some post-build-checks from our distro build
system, better to upstream it:
[ 4077s] E: rust 64bit-portability-issue
/home/abuild/rpmbuild/BUILD/rust-0.11.0+git.1403898616.aa1163b/src/libbacktrace/dwarf.c:2690,
2873, 3005
[ 4077s] E: rust 64bit-portability-issue
/home/abuild/rpmbuild/BUILD/rust-0.11.0+git.1403898616.aa1163b/src/libbacktrace/elf.c:448,
493, 970
[ 4077s] E: rust 64bit-portability-issue
/home/abuild/rpmbuild/BUILD/rust-0.11.0+git.1403898616.aa1163b/src/libbacktrace/fileline.c:75
libbacktrace/ChangeLog:
2014-07-03 Yaroslav Sidlovsky <zawertun@gmail.com>
* dwarf.c, elf.c, fileline.c: fix pointer from integer without a
cast
diff -U 3 -H -d -r -N -- rust-0.10.orig/src/libbacktrace/dwarf.c rust-0.10/src/libbacktrace/dwarf.c
--- rust-0.10.orig/src/libbacktrace/dwarf.c 2014-04-03 04:03:08.000000000 +0400
+++ rust-0.10/src/libbacktrace/dwarf.c 2014-04-21 12:01:59.803278408 +0400
@@ -2687,7 +2687,7 @@
}
if (state->threaded)
- lines = backtrace_atomic_load_pointer (&u->lines);
+ lines = (struct line *) backtrace_atomic_load_pointer (&u->lines);
new_data = 0;
if (lines == NULL)
@@ -2870,7 +2870,7 @@
pp = (struct dwarf_data **) (void *) &state->fileline_data;
while (1)
{
- ddata = backtrace_atomic_load_pointer (pp);
+ ddata = (struct dwarf_data *) backtrace_atomic_load_pointer (pp);
if (ddata == NULL)
break;
@@ -3002,7 +3002,7 @@
{
struct dwarf_data *p;
- p = backtrace_atomic_load_pointer (pp);
+ p = (struct dwarf_data *) backtrace_atomic_load_pointer (pp);
if (p == NULL)
break;
diff -U 3 -H -d -r -N -- rust-0.10.orig/src/libbacktrace/elf.c rust-0.10/src/libbacktrace/elf.c
--- rust-0.10.orig/src/libbacktrace/elf.c 2014-04-03 04:03:08.000000000 +0400
+++ rust-0.10/src/libbacktrace/elf.c 2014-04-21 12:17:50.977257617 +0400
@@ -445,7 +445,7 @@
{
struct elf_syminfo_data *p;
- p = backtrace_atomic_load_pointer (pp);
+ p = (struct elf_syminfo_data *) backtrace_atomic_load_pointer (pp);
if (p == NULL)
break;
@@ -490,7 +490,7 @@
pp = (struct elf_syminfo_data **) (void *) &state->syminfo_data;
while (1)
{
- edata = backtrace_atomic_load_pointer (pp);
+ edata = (struct elf_syminfo_data *) backtrace_atomic_load_pointer (pp);
if (edata == NULL)
break;
@@ -967,7 +967,7 @@
{
fileline current_fn;
- current_fn = backtrace_atomic_load_pointer (&state->fileline_fn);
+ current_fn = (fileline) backtrace_atomic_load_pointer (&state->fileline_fn);
if (current_fn == NULL || current_fn == elf_nodebug)
*fileline_fn = elf_fileline_fn;
}
diff -U 3 -H -d -r -N -- rust-0.10.orig/src/libbacktrace/fileline.c rust-0.10/src/libbacktrace/fileline.c
--- rust-0.10.orig/src/libbacktrace/fileline.c 2014-04-03 04:03:08.000000000 +0400
+++ rust-0.10/src/libbacktrace/fileline.c 2014-04-21 11:33:37.790315610 +0400
@@ -72,7 +72,7 @@
if (!state->threaded)
fileline_fn = state->fileline_fn;
else
- fileline_fn = backtrace_atomic_load_pointer (&state->fileline_fn);
+ fileline_fn = (fileline) backtrace_atomic_load_pointer (&state->fileline_fn);
if (fileline_fn != NULL)
return 1;